Hello,
is it possible in ArcGIS Survey123 Web Designer to limit an entry in a Number field to 1 OR 0.
The constraint I have set below in example image still allows entries such as 00, 001 etc etc.
Thanks
Hey @CMcDonald
Here's a suggestion from another user in the solution, setting yes or no to 1 and 0, and then returning the number:
https://community.esri.com/t5/arcgis-survey123-questions/return-a-boolean-value-0-or-1-different-tha...
You would also be able to set regex inside of the XLSForm: regex(., '^(0|1)$')
This would restrict it to be 0 or 1 as requested.
Cody
Hi @CodyPatterson unfortunately that solution is using Survey123 Connect, I don't use that.
Hey @CMcDonald
Ah I see, sorry about that, instead, would it be possible to use radio buttons to create a choice question, I attempted this here and it returned only 1 or 0 depending on the choice:
This is a single select question:
Cody
Hi @CodyPatterson Yes I tried this as it would be a slightly better solution but at the end of each section I have to perform a calculation i.e. Question1 + Question2 =
I could not get a calculation to work when the questions were of Single select type 😞
Hey @CMcDonald
Ah alright I see, so you are wanting to create a sum of the answers then? If so, I would want to see what error you're facing, you may need to convert the question result to an integer, it may be coming over as a string and is not able to be added due to the types being different.
Cody
Hi @CodyPatterson yes I think because I'm trying to add numbers from a text field it cannot work. Under the Calculation in the Number field using Number the question does not appear in the dropdown.
The goal originally was to have Single select type questions with "Yes" and "No" entries. Yes would = 1 No would = 0. However it didn't appear to be possible to tot up a total score in the Web Designer. Hence my workaround of just using 1 and 0 now.