Jump to content
  • 1

Formatting a mobile phone number


LisaMee
 Share

Question

I am wanting to pass a customers mobile phone number to twilio via zapier. However twilio wants it in a very specific format. it needs the country code then the mobile number without the zero.

So my customers will enter the number as 075xxxxxxxx

and i need it as 4475xxxxxxx

can anyone give me the javascript in order to do this? Thanks

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 1
On 7/18/2017 at 8:25 PM, LisaMee said:

I am wanting to pass a customers mobile phone number to twilio via zapier. However twilio wants it in a very specific format. it needs the country code then the mobile number without the zero.

So my customers will enter the number as 075xxxxxxxx

and i need it as 4475xxxxxxx

can anyone give me the javascript in order to do this? Thanks

Hi LisaMee,

I would suggest using Formula field to modify users input.

Hope this helps.

Link to comment
Share on other sites

  • 0

Hi, just to add in the previous comments above, phone formatting is also possible using calculated fields, calculated values or even in Formula fields.  You may use this formula:

CASE WHEN
[@field:Phone_Number] != ' '
THEN
'(' + SUBSTRING([@field:Phone_Number], 1, 3) + ') ' + ' ' + SUBSTRING([@field:Phone_Number], 4, 3) + '-' + SUBSTRING([@field:Phone_Number], 7, 4)
ELSE
[@field:Phone_Number]
END

Link to comment
Share on other sites

  • 0

Hi All - In relation to Caspio's new feature of Worldwide SMS Notifications, if you would like your input phone number fields to be automatically formatted - you can use the International Telephone Input plugin. This JavaScript plugin is used for entering and validating international telephone numbers. It adds a flag dropdown to any input, detects the user's country, displays a relevant placeholder, and provides formatting/validation methods. To know more of the customization, you can check this link: https://github.com/jackocnr/intl-tel-input

Here's a sample result in DataPage:

image.png

After submission in table:

image.png

Related articles:

https://howto.caspio.com/notifications/sms-notifications/configuring-the-sms-enabled-countries/
https://howto.caspio.com/release-notes/caspio-32-0/

Hope it helps!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...