Select to view content in your preferred language

When adding a point in Survey123 map is it possible to inherit attributes from feature layer in the map

520
2
05-11-2022 03:44 AM
PeterGreen_CEC
New Contributor II

I have created a fairly basic survey in Survey123, which includes a map where users can indicate the location of visitor incidents within a park boundary. The park is subdivided into a number of administrative areas. The survey map includes hosted feature layers representing both the park and administrative boundaries.  I was wondering if it is possible that when the user indicates the location of the incident on the survey map that the name and id of the corresponding administrative unit, which are contained in the administrative boundary feature layer's attribute table, could be added to the new point feature. Basically, I'd like to transfer the name and id of the administrative unit to each incident point as they are created.

Not sure if such a thing is possible, but figured I'd ask. I know I can do this after the fact with a spatial join but hoping it might be something possible with the survey itself.

Thank you.

2 Replies
ZacharySutherby
Esri Regular Contributor

Hello @PeterGreen_CEC

This is possible using a custom JavaScript function in Survey123. Please do note that if you intend for your form to be public custom JavaScript functions don't work in public forms. 

I've attached an example that demonstrates a point in polygon lookup using a custom JS function. 

Please refer to these help topics for more information on JS functions in Survey123: 

https://community.esri.com/t5/arcgis-survey123-blog/extending-survey123-smart-forms-with-custom-js/b...

https://doc.arcgis.com/en/survey123/desktop/create-surveys/pulldatajavascript.htm

Thank you,
Zach
PeterGreen_CEC
New Contributor II

Thank you for your response, @ZacharySutherby. That's very helpful. It is likely to be a public form so although the option may not work in this case it's a great solution for future projects.

Kind regards,

Peter

0 Kudos