Survey123: Is it possible to format a phone number?

1950
5
Jump to solution
05-09-2019 06:04 AM
Highlighted
Occasional Contributor III

Is it possible to format a phone number? When the user starts to type the digits the form automatically adds dashes between 330 - 111 - 1111 

Tags (1)
1 Solution

Accepted Solutions
Highlighted
Esri Frequent Contributor

Hi. You can use inputmasks which are described at Esri custom columns—Survey123 for ArcGIS | ArcGIS 

An inputmask for a phone number would look something like 999-999-9999

Please note you can only define inputmasks in Survey123 Connect (not available in Survey123 Designer). Also, input masks are only honored in the Survey123 field app (they are ignored in web forms).

typenamelabelbody::esri:inputMask
textphonenumberPhone Number999-999-9999

View solution in original post

5 Replies
Highlighted
Esri Frequent Contributor

Hi. You can use inputmasks which are described at Esri custom columns—Survey123 for ArcGIS | ArcGIS 

An inputmask for a phone number would look something like 999-999-9999

Please note you can only define inputmasks in Survey123 Connect (not available in Survey123 Designer). Also, input masks are only honored in the Survey123 field app (they are ignored in web forms).

typenamelabelbody::esri:inputMask
textphonenumberPhone Number999-999-9999

View solution in original post

Highlighted
New Contributor III

Hello Ismael,

Will the masks be honored by web forms at some point? They work great on the field app, but I am currently working on a Survey that will only be taken on the web browser.

Thank you,

Martin

Highlighted
Occasional Contributor III

Hi Ismael,

I have a mobile phone mask structured as: 

9999 999 999

When testing in Connect the mobile phone number works as expected with the correct spacing and when captured in web browser the resulting record is 0401234567 without the spacing. That is ok.

I then added a new field to capture the formatted string with the desired spaces:

concat(substr(${mobile},0,4), ' ',substr(${mobile},5,8), ' ',substr(${mobile},9,12))

I was expecting 0401 234 567 (as returned when testing in Connect) but instead had a return value of 0401 34 67 (when using the web browser). I can only assume the web browser is recording some values as empty spaces, so something is behaving odd between Connect and web browser.

Your thoughts.

Regards,

Craig

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi Craig,

Input masks are not supported yet in the web form - this could be considered a symptom of that.

Highlighted
Occasional Contributor III

Thank you James.

Reply
0 Kudos