Convert a international phone number format

Hi all!

On an api request I get the number of whatsapp

+5511988998899

but to find a person on my CRM I need to find with +55 11988998899.

How can I parse this number and convert with this space?

Hi, this is pretty simple to do assuming it will always be a 14 character string and the position will always be the same. You will need to select the “Text and binary tabs” in whatever module you want to modify and select the “Substring” function.
Insert your original number in the first slot and then type 0 and 3 after the semicolons. This will return the first part of the string “+55”. Then repeat this process again except put a 4 and 14 between the semicolons. Also remember to put a space between the two functions

Hope this helps.

3 Likes

What if the country code is a single digit or three digits long?

Don’t you think there should be a better way to parse an international phone number into its country code and local number?

3 Likes

Hello,

there is a Parse a phone number module you can use to get the number in several different formats.

3 Likes