Is substring function working with numbers?

:bullseye: What is your goal?

Convert a chain of numbers in a valid format to use as WhatsApp number

:thinking: What is the problem & what have you tried?

I am using the substring function to convert a chain of numbers in a valid format to use as a WhatsApp number, but it is not working. I am using the correct function? Or does the substring function work only with text? In my exact case, I need to add the prefix (549) at the beginning of the phone number (Ex: 1140935678), achieving this result (5491140935678). For some reason, the function isn’t converting the number. It always returns the same value in the output. Thanks!

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

Welcome to the Make community!

You can use this built-in function, to always guarantee that the text string always begins with your chosen string.

  • replace
    replace(text; search string; replacement string)

Here’s an example of how you can use this function:

549{{replace(8.phone; "/^549/"; emptystring)}}

(copy-paste the above into the field, or type it exactly as shown)

e.g.:
image

Hope this helps! If you are still having trouble, please provide more details.

— @samliew
P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

What does the input string look like? If its a phone number already, then you can use the Parse a phone number module to convert it in several formats, the international one should work for whatsapp.