Hello everyone!
I am new to ArcGIS Survey123 Connect. I have a hidden field {charac} which contains characters in the default column. I used the function regex (., ${charac}) as constraint in the {name} field to prevent users from inputting characters in the {charac} field.
Question is, how to trigger an error note and code it in the relevant column the moment users include those invalid characters as input in the {name} field?
For example:
An error note "Error: The name field contains invalid characters!" will appear once a sample input "MARIA'S. CRUZ" (with invalid characters: apostrophe and period) is inputted in the name field.
I appreciate any hints or ideas on this. Thank you very much in advance.
Not sure why you have a hidden question. You can just include the values in the constraint expression.
For the 'name_' question:
Also noted you have renamed the name field to 'name_'. Would definitely recommend just a better field name that is not 'name' as it's a reserved word, and affixing '_' isn't the best fix...
Hello. Thank you very much for replying.
I also tried your suggestion not(regex(.,'[|\x27|\x5C&@;"/?+#$]')) before since I read this from other users as well. However, it doesn't seem to work in my end. So, I decided to use a different approach and it's actually working.
I already used constraint before. However, if I'm not mistaken, the user will only be able to see the constraint message when you click the submit button.
In my case, I want the error message to appear before the user proceeds to the next field in the form, and not during the submission of the form after filling out all the fields.
I have this idea in my mind to use an if statement in the relevant column, but I can't seem to form any. If you have any suggestion, I appreciate any hints. Thank you very much.
@DougBrowning has an excellent guide to getting real-time notifications of errors.
It does require a few extra, hidden questions, but it works great.
How to simulate instant data checking using emojis - Esri Community