Let's consider workflows when survey submission should be dependent on the user's location inside/outside of a boundary and where we might want to control these submissions using our Survey123 form...
One method of quality control might be to restrict submissions based on where field workers are located in regards to specific geometry (i.e. within council boundary, 10m from a major freeway, on private property, etc...)
This workflow will utilise a modified version of the "url_requests.js" script from the above sample survey. To follow along with this example, you'll need the following:
In this example, we're simply going to indicate whether a Survey123 mobile app user is inside or outside of a set boundary (polygon feature layer) using an intersect query, and limit their submission capability accordingly...
Create a new survey from file, using the "OutOfBounds.xlsx" form mentioned above.
To store our script(s), we'll want to create a folder within our Survey project location titled "scripts", as follows:
We'll start by adding a "geopoint" question to our survey.
Then, add a "hidden" question and place the service URL of your polygon feature layer in the Default column.
We're going to save the following script (attached; "OutOfBounds.js") into our "scripts folder and reference it from within our survey form to carry out the intersect query and return a string relevant to whether the geopoint lies within the feature service polygon boundary or not.
In a 'note' question, we add the following function to the calculation field:
Furthermore, we might like to add extra questions for quality control of our field team:
The result for the end-user in the Survey123 mobile application may look similar to the following:
Other quality control considerations and notes:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.