Skip to content

Field Service – OPA- Integration using OPA interview url parameters

Field Service – OPA- Integration using OPA interview url parameters

1 - Login to Field Service as Administrator

2 - Go to Configuration - Forms & Plugins

3 - Create a new plugin

4 - Provide a name for the General Information section

5- Change Type to : Native Application

6 - Provide a name for Native Application name

7 - Set Browser user agent mask to *

8 - Provide the OPA Interview URL.

a) if no data is sent to the interview from field service then just copy past the interview url.

b) if data is sent from field service to OPA then the interview URL will have the following format

<OPA DOMAIN>/web-determinations/startsession/<OPA DEPLOYMENT NAME>?seedData={param1:"{field_service_field_name}",param2:"{field_service_field_name}"}

However in order for this to work, you have to encode the seedData JSON but not the names of the field service fields.

Example :

https://<OPA HUB DOMAIN>/web-determinations/startsession/DINextAction?seedData={sr_no:"{wo_sr_number}",wo_ID:"{appt_number}"}

URL encoded seedData JSON is %7Bsr_no%3A%22{wo_sr_number}%22%2Cwo_ID%3A%22{appt_number}%22%7D

The final URL for the interview is:

https://<OPA HUB DOMAIN>/web-determinations/startsession/DINextAction?seedData=%7Bsr_no%3A%22{wo_sr_number}%22%2Cwo_ID%3A%22{appt_number}%22%7D

Where: sr_no and wo_ID are OPA attribute names

wo_sr_number and appt_number are field service attributes (you can find the names in configuration-properties under Property label)

Once the link is created, add it to the plugin.

Then go ahead and expose this plugin on your page.

Note: make sure the field service attributes used are also exposed and visible on the page in field service.

The result is as follows:

Leave a Reply

Your email address will not be published. Required fields are marked *