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
Solved! Go to Solution.
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).
type | name | label | body::esri:inputMask |
---|---|---|---|
text | phonenumber | Phone Number | 999-999-9999 |
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).
type | name | label | body::esri:inputMask |
---|---|---|---|
text | phonenumber | Phone Number | 999-999-9999 |
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
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
Hi Craig,
Input masks are not supported yet in the web form - this could be considered a symptom of that.
Thank you James.
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.
@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!
Any timeline for masks being added to web forms? @JamesTedrick
If you are just looking to capture phone numbers in your Survey123 form you DO NOT need to use Survey123 Connect. The "NUMBER" form block does not support input masks, but the "SINGLE LINE TEXT" block does, so use the single line text instead of number block for capturing phone numbers and area codes.