I am using Survey 123 connect (version 3.13.249) to create a survey. One field is a geocode service bound (see screenshot of the row in the excel for Survey 123 Connect below). This is to make sure the user select a valid address from the autocomplete list of addresses. Also, the entry is location based.
But I have found an issue with this field entry. The user is able to input any text in the field and submit the form successfully.
I am wondering - is there a way to validate the user input - making sure the address is selected from the address autocomplete list? This is public survey. From this doc https://doc.arcgis.com/en/survey123/desktop/create-surveys/pulldatajavascript.htm, JavaScript doesn't work from public survey.
Here is the screenshot of the row in the excel for Survey 123 Connect.
Thanks so much
Solved! Go to Solution.
Hello @HelenZhou,
You can set up a calculate question after your address question that calculates the match score based on the address question. If the match score is 100% then an address was selected from the drop down, if it's anything less then the user likely typed an answer. You can then take that calculated value and place a constraint on the address question where the match score needs to be 100%. Please see this Esri Community blog for more information.
The calculation for the match score will be pulldata("@json",${address_question},"attributes.Score")
Hello @HelenZhou,
You can set up a calculate question after your address question that calculates the match score based on the address question. If the match score is 100% then an address was selected from the drop down, if it's anything less then the user likely typed an answer. You can then take that calculated value and place a constraint on the address question where the match score needs to be 100%. Please see this Esri Community blog for more information.
The calculation for the match score will be pulldata("@json",${address_question},"attributes.Score")
Thank you @ZacharySutherby that works! Actually I have another calculated field in my form to calculate the latitude of the selected address. I use this field != 0 as the constraint.
What I am seeing is that the score is pretty much always 100 if using the World Geocoder. Of course you can create a view off of that but must share it publicly for those not logged in to use it. This is not an option for us. Using the world geocoder basically finds a match for anything. There has to be a better way to catch bad addresses?