I am new to using survey 123 so I apologize for the question. I want to set it so only one decimal place can be entered when the field teams fill in the form. Is there a formula so I can do this.
thank you in advance
I have a similar situation where I let the user fill out the field with however many decimal places they desire but in a "calculated field" I round the value to 2 decimal places using round(sum(${name_of_input_field}),2) in the calculation field. Seems to work fine for my needs.
You could restrict users to one decimal place using a regular expression in the constraint column.
This regular expression, for example, allows the user to input between 1 and 10 numbers before the decimal, and 1 after:
regex(., '^[0-9]{1,10}\.[0-9]{1}$')
This page has some details and examples dealing with regular expressions:
Formulas—Survey123 for ArcGIS | ArcGIS
I have this question too. I want to restrict the users to one decimal place but let the user input something like 30.3 or 3.1 without having to write 03.1, because the survey users won't know what the precision and scale is. Has anyone ever found a work around to this?
https://community.esri.com/migrated-users/3966 What do you mean above by putting a regular expression in the constraint column? Would we have to put in all the possibilities such as 0.1, 0.2, 0.3............99.9 etc?
What about specifying the scale on a decimal for calculated values. inputMask seems to only work when you know the precision and scale, like a percent (99.9%). I need to show 1 place past decimal even if it is 0; .1, 1.0 or 200.0 needs to be allowed. The round function knocks off the 0, but I need to show scale of 1 no matter.
Hi! I suggest you try the inputMask column in your XLSForm. You can find info about inputMaks in this help topic. It looks like a value of 9.9 in your inputmask would do the trick.
The input mask controls user input as values are entered in the input box. Incorrect values are shown in red, but once you have a value that matches the mask it will switch to black.
Another approach is to use a regular expression in the constraint column.
By the way! Once you can spell Survey123 without a space between Survey and 123, you qualify as a Survey123 Ninja.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.