Syntax for email address field input mask?

10933
6
Jump to solution
03-29-2018 07:20 AM
BrentKinal1
Frequent Contributor

I feel like in a past post I saw some syntax for using an input mask for an email address field, If I wasn't dreaming this and one exists please share the syntax.

Thanks!

Brent

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JamesTedrick
Esri Esteemed Contributor

Hi Brent, 

Input masks don't work with arbitrary length text portions, as you would expect from parts of an e-mail address.  As  documented, you can use a regex function to validate an email address:

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,}))$')

View solution in original post

6 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Brent, 

Input masks don't work with arbitrary length text portions, as you would expect from parts of an e-mail address.  As  documented, you can use a regex function to validate an email address:

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,}))$')
GISManager4
Regular Contributor

Hi, @JamesTedrick I tired the syntax in the constraint field, but it doesn't appear to work on Connect v3.22.49

0 Kudos
TCKauhi
Occasional Contributor

Thank you and this works great when the user completes the form through a web browser, however, the constraint does not appear to get carried over to the mobile app. Is there a way to ensure users enter only email addresses in the mobile app too?

0 Kudos
TCKauhi
Occasional Contributor

Please disregard my question, I see that in the mobile app, the user must submit the form before the user gets the error message (a little different than in the web browser). Thank you!

0 Kudos
Survey123Jedi
Occasional Contributor

@JamesTedrick 

I'm getting this text populating 3.14 Survey123 Connect.

I haven't used the email body::esri:inputMask in a while, what am I doing wrong?

Survey123Jedi_0-1649644832461.png

 

0 Kudos
IgorAtamanchuk
Occasional Contributor

Hi,

The regex needs to be inputed into the "constraint" column in your XLSForm. Also, it seems like the preview won't show the validation, but it works well when the form in published. Hope this helps

0 Kudos