Syntax for email address field input mask?

7831
3
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

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