I appear to be full of Survey123 questions lately. 🙂
Given a survey with a map that has a layer defining a service area (example below) how can you confine answers (map points) that are within that polygon shape? What if there are multiple unconnected polygons? I've seen a few answers for creating single, rectangular constraints, but can't seem to find info on polygons. And I've seen nothing on creating multiples, if you have several, unconnected, areas.
Road service areas.
Solved! Go to Solution.
Hello @RogerAsbury,
One option would be to use the new pulldata @layer functionality we just implemented with our 3.16 release. Assuming you have a previous question that requests for the service area you can use pulldata @layer to do a point in polygon lookup and verify that the location set in the geopoint is identical to the service area selected. That way your constraint would just need to be ${questionA}=${calculationA}.
Please see this survey for a live example: https://arcg.is/1braCn
If you select a state from the drop down list a geopoint question will then become relevant, if your geopoint location doesn't reside in the state you selected then a constraint will prevent submission, otherwise if you select the state your geopoint resides in you can submit the survey.
Source XLSForm is attached below.
Hello @RogerAsbury,
One option would be to use the new pulldata @layer functionality we just implemented with our 3.16 release. Assuming you have a previous question that requests for the service area you can use pulldata @layer to do a point in polygon lookup and verify that the location set in the geopoint is identical to the service area selected. That way your constraint would just need to be ${questionA}=${calculationA}.
Please see this survey for a live example: https://arcg.is/1braCn
If you select a state from the drop down list a geopoint question will then become relevant, if your geopoint location doesn't reside in the state you selected then a constraint will prevent submission, otherwise if you select the state your geopoint resides in you can submit the survey.
Source XLSForm is attached below.
Awesome! Thanks much for pointing me that way. Been wondering this for a bit. Glad to see something was recently posted. 🙂
I have also done the low tech way. Read the lat and long into a field using pulldata then set a constraint on those numbers.
I also have done it where it passes in the lat/long the crews are supposed to try and get to into the form from Field Maps. Then I use a calc to see how far their current location is from where they are supposed to be. As they refresh the map question the distance updates. Then I can set a constraint on that distance. Worked out well.
How is this done if it is only based on location and not an input question value? I used a point in the same buffer polygon to add Name value to the new point feature, but I need to constrain the point location within the same buffer polygon feature service (contains several polygons). The example shown is the functionality I need but I need help finding the right way to set it up.
I'm wondering if you came across any other information on how to do this. I'm working on a project where I'm hoping to implement a geopoint question that checks if the point is within a polygon on the basemap.
Thanks in advance!
I did get information at the Esri users conference to make this work. It was the constraint part setup that I had been missing.