Survey123: Is it possible to format a phone number?

9648
11
Jump to solution
05-09-2019 06:04 AM
JordanMiller4
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
IsmaelChivite
Esri Notable 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

11 Replies
IsmaelChivite
Esri Notable 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
MartinDe_Las_Heras
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

CPoynter
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

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Craig,

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

CPoynter
Occasional Contributor III

Thank you James.

0 Kudos
SFM_MickieSmith
New Contributor III

Why is the input masks not honored in the web form?  I'm using Survy123 connect V3.13. Is there a work around?  Being able to use the input mask for a web form would make it easier for the form to be filled out.

RutledgeNicholas
New Contributor III

Is it possible to put (999) 999-9999 in the input mask column to use parenthesis for the area code instead of hyphens?

0 Kudos
TristanSHiggins
New Contributor

Yes, you can use parentheses in the input mask, they'll appear as placeholders to indicate the formatting for the user as below:

TristanSHiggins_0-1699897121405.png

 

 

0 Kudos
Daniel_Perkins
New Contributor III

@JamesTedrick , having issues with the with the inputmask for phone numbers, using Survey123 Connect and an Android phone. Am using 999-999-9999. It appears to work correctly in the Survey123 Connect preview, but when typing in Survey123 app on the phone there are some oddities. When entering the phone number as "123-456-7890", I see "123-567-90" ... It's as if each hyphen is covering up a digit. If I manually type "123space456space7890" it appears as I would expect, "123-456-7890"

Any thoughts? Thanks in advance!