Select to view content in your preferred language

Limit survey responses to places inside a specific feature

228
3
06-29-2024 12:54 AM
BrunoLeitão
New Contributor
I have a public survey in which I want the answers to be only within a certain area (Douro Valley, Portugal). How can I limit survey submission if the requested location is within this zone? Thanks

 

3 Replies
jcarlson
MVP Esteemed Contributor

Take a look at pulldata("@layer"...)

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-pulldata-quot-laye...

If you have a feature layer that corresponds to the zone, you can add a constraint to your form. Create a read-only field in your form, and use pulldata("@layer") to retrieve the name or ID of the intersected zone. If it does not match the attribute of the Douro Valley zone, you can use a constraint to block the form from submitting.

You can set the read-only field to a "null" type, too, and not waste space storing a useless field.

We do something similar with a form of ours, where submissions are expected to fall in certain areas, and the form will not accept a submission where the point falls outside of the features we specify in our constraint.

- Josh Carlson
Kendall County GIS
0 Kudos
DougBrowning
MVP Esteemed Contributor

Or the old poor mans way.  Grad the lat long and but a constraint on that.  Not perfect but it works ok.

0 Kudos
abureaux
MVP Regular Contributor

Just tossing this out there, but true geographic location and what S123 (or any GPS app) reports can be two different things. Just don't expect any solution to be 100% accurate since you could end up filtering out legitimate submissions due to users being in the "wrong" location.

If you are set on this behaviour though, jcarlson and DougBrowning have given two fantastic solutions.

0 Kudos