Select to view content in your preferred language

URL passing labels, not coded values, to Survey123

705
1
Jump to solution
01-11-2023 05:48 PM
ahmdes
by
New Contributor

I am using a URL in a Field Maps popup link to open a Survey123 form and pass field values from the parent table, populated in Field Maps, to a related table, which is then edited via the Survey123 form. When I use the link in the Map Viewer popup of the Web Map I use for Field Maps, opening the Survey123 form in the Windows Survey123 app, the coded values of the fields are passed to the form. This is the behaviour I would expect and what I want. However, when I use Field Maps on a mobile device, opening the mobile (iOS) Survey123 app, it looks like it is passing the fields' labels rather than the coded values.

I'm happy to provide extra information if need. Thank you!

0 Kudos
1 Solution

Accepted Solutions
ChristopherCounsell
MVP Regular Contributor

By default, values can only be passed to select one or select multiple questions from a pop-up in a web map if the name and label of the corresponding choice are identical. If the names and labels in your choice list are different, you can use the DomainCode or UrlEncode functions in an ArcGIS Arcade expression in the pop-up to pass the desired value.

https://doc.arcgis.com/en/survey123/reference/integratewithotherapps.htm

You need to add an expression to your Web Map layer and then use the expression in place of the field for the custom URL scheme e.g.

https://doc.arcgis.com/en/arcgis-online/create-maps/configure-pop-ups-mv.htm#ESRI_SECTION1_BE0D1CA2E...

expression/expr1:

DomainCode($feature, 'fieldname')

Then update the URL:

arcgis-survey123://?itemID=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&field:targetfield={fieldname}

becomes:

arcgis-survey123://?itemID=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&field:targetfield={expression/expr1}

View solution in original post

1 Reply
ChristopherCounsell
MVP Regular Contributor

By default, values can only be passed to select one or select multiple questions from a pop-up in a web map if the name and label of the corresponding choice are identical. If the names and labels in your choice list are different, you can use the DomainCode or UrlEncode functions in an ArcGIS Arcade expression in the pop-up to pass the desired value.

https://doc.arcgis.com/en/survey123/reference/integratewithotherapps.htm

You need to add an expression to your Web Map layer and then use the expression in place of the field for the custom URL scheme e.g.

https://doc.arcgis.com/en/arcgis-online/create-maps/configure-pop-ups-mv.htm#ESRI_SECTION1_BE0D1CA2E...

expression/expr1:

DomainCode($feature, 'fieldname')

Then update the URL:

arcgis-survey123://?itemID=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&field:targetfield={fieldname}

becomes:

arcgis-survey123://?itemID=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&field:targetfield={expression/expr1}