International format for phone number

Dear Friends, I would like to request your help with the following.

I have a json that gives me the phone number of my clients, the problem is that clients put the number in different ways, some put the country code 58912345678, others without putting country code only 912345678 and others put with a leading zero eg. 0912345678, the data that I need must be in the international format, or either with the country code (58912345678).

what would be the function or node that I should use to extract the last 9 digits and concatenate the country code 58 at the beginning?

Thank you!

Hi @patomi,

To get the last 9 you would use variable_name.slice(-9) you could also pop your prefix before it and use it in the expression editor so no need for a function.

2 Likes

Great thank you very much !!!
working perfect like this:

{{$json[“Phone”].segment(-9)}}

Thank you very much for your quick and excellent help.

1 Like

No worries, happy to help :+1:

Hi! Can you share the workflow code to import?

Sure, I am sending you the flow of what worked for me.

Hopefully it will be of help to you.