Survey123 Connect: Need to have user enter email address; RegEx isn't working

2294
5
12-02-2019 04:46 AM
by Anonymous User
Not applicable

Hey all!

Hopefully this is a really easy question to answer: I have a form on Survey123 Connect and need to have a user enter an email address as a part of the form. The people filling out the survey do not have ArcOnline accounts, so they have to enter in a valid email address. I've tried entering the following regex string into the "constraint" field, but it doesn't seem to work:
regex(., '^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$')

See my screenshot for the other fields' values. Any ideas on what I'm doing wrong?

Tags (1)
0 Kudos
5 Replies
DeonLengton
Esri Contributor

I added the following in the constraint of a text field and it seems to be working fine:

regex(., '^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$')
by Anonymous User
Not applicable

Quite odd. It's not showing any error in Survey123 Connect (if I start typing an email but don't complete it), but when I publish, it does what it's supposed to. In the same form but different field, the opposite is happening: I have a phone number field with an input mask ( (999)999-9999 ) and it shows/works correctly in Survey123 Connect, but after it's published and viewed online, it doesn't work correctly. Any ideas?

0 Kudos
by Anonymous User
Not applicable

Got it. I'm on a desktop, and apparently input masks only work with the Field App. Used a constraint instead. Would really like to have the dashes automatically input, but this may work.

0 Kudos
KimberlyMcCallum
New Contributor III

regex is such a mysterious beast to me so I am so grateful for those kind enough to share expressions! I am using this and it seems to be working like a charm. Thank you!

0 Kudos
Survey123Jedi
New Contributor II

I'm using Survey123 Connect 3.14.261, and it's acting up with my regex code. Any ideas why? See how the text is showing in the field.

Survey123Jedi_0-1648945279820.png

 

0 Kudos