Integrating Workforce with Survey123 using layer popups

3456
26
11-27-2018 01:45 PM
AlexGerrish1
New Contributor III

We've successfully integrated Survey123 with Collector using custom URLs in popups but we are hitting a roadblock while integrating Survey123 with Workforce using the same method. In Workforce, the same URL will successfully download the target survey but none of the parameters therein are passed on.

I see that Workforce can integrate with both Collector and Survey123 at the assignment level but we've been unable to pass attributes from existing facilities, containers, buildings, etc. to the inspection form using this method.

The URL successfully passes all parameters and looks like this:

arcgis-survey123://?itemID=b4d070xxxxxxxxxx&field:WasteState={WasteState}&field:WasteStream={WasteStream}&field:saa_id={SAA_ID}&field:saa_building={Building}&field:saa_loc={SpecificLocation}

Do I have to adjust my syntax for this link to pass the parameters in Workforce or is there another step to do this?

0 Kudos
26 Replies
by Anonymous User
Not applicable

Hi Alex,

So if I understand correctly, you have another layer in the Workforce Worker Webmap. In that layer there are features that have a custom popup. In that custom popup a link generated dynamically to open Survey123. A worker then taps on a feature, and taps on link in the popup. They then expect the survey to download and have the parameters passed in.

You are not using the Assignment Integrations that are native to Workforce.

Is that correct?

0 Kudos
AlexGerrish1
New Contributor III

That is correct. The Inventory feature layer (the objects being inspected) and the Inspections table (composed of completed surveys) share a relationship as a way to associate multiple inspections to a single object. They expect some parameters to pass in before they fill the rest themselves.

We are not using the native assignment integrations.

0 Kudos
by Anonymous User
Not applicable

Hi Alex, 

I tested this on iOS and I am able to reproduce this issue when there are multiple fields specified in the url (which is your case). It does seem to work when there is only one field specified. The issue is due to how the popup info is parsed.

I also tested against our daily build and I could not reproduce the error. So this issue should be resolved in the next release of Workforce iOS.

0 Kudos
AlexGerrish1
New Contributor III

Hi Aaron,

I'm glad to hear it. Thanks for chasing that down so quickly. I should mention this is all a workaround to pass parameters from an existing point feature to the survey form. We would be able to use the native integration if assignment features could inherit certain attributes from a point feature they were created from. We would also need to be able to select a related table instead of the geometry layer as the 'Survey123 Question'.

by Anonymous User
Not applicable

One (more advanced) workflow that could solve the first part of your problem is adding additional fields to the assignments feature layer. For example you could add a "saa_building" field. If you are creating assignments programmatically then you could add the additional information when the assignment is created. One thing to note is that the additional fields will not be displayed in the mobile or webapps, however, the attributes could still be passed to Survey123 (or other apps) as part of a custom integration you add to the project.

We would also need to be able to select a related table instead of the geometry layer as the 'Survey123 Question'.

Could you expand on this? I don't follow. Does your Survey have an additional related table?

0 Kudos
AlexGerrish1
New Contributor III

The Survey contains a related table whose schema reflects the survey form. The survey was created from a map service featuring the SAA_Inventory (objects to be regularly inspected) and a related SAA_Inspections table. The form was customized to fill the related table rather than the inventory layer. The inventory layer has some attributes (like container type and building name) that are necessary for context but it's the inspections table that needs to be passed the parameters and filled out per inspection. This was a previous workaround to get multiple inspections to relate to one object without creating a bunch of points.

The integration only gives the option to pass information to the inventory layer in this case.

0 Kudos
CraigGillgrass
Esri Regular Contributor

Alex,

We really appreciate the feedback. Being able to create new records in related tables is in our backlog to tackle.

One your request for assignment features to inherit certain attributes from the point feature they were created from; what are your requirements for where the field mapping between Assignments and features should be specified?

Is this a field mapping that is defined for the entire Assignment feature layer?

Or, is the field mapping specific to each Assignment Type?

thanks,

Craig

0 Kudos
AlexGerrish1
New Contributor III

Hi Craig,

We only have one assignment type for the project in question, so we could specify the field mapping for the entire feature layer. However, having the option to specify the schema for multiple assignment types would be ideal.

I hope this answers your question.

0 Kudos
AndrewHargreaves2
Occasional Contributor III

Aaron Pulver‌ I did this - added extra fields to my Assignment layer with the hope of populating them with attributes from my assets that I want to inspect. However, as I'm not generating assignments programmatically, but through the WorkForce dispatcher map/app I can see no way of passing values from the asset into the assignment. Is this possible?

0 Kudos