Skip to main content

Hi there.  I am attempting to format a phone number in order to remove the parenthesis, dashes and spaces.  I have done this a number of times in other zaps and have not run into any issues.

For some reason, on the zap sequence I am building today - the phone number formatter is not working properly.

I recorded a 1 minute video showing what it’s doing, please take a look and let me know what you think.  Am I crazy?  This has worked for me in the past…

 

https://www.loom.com/share/1c1a131a89c24d688d870e0fa28835d8

 

Hi @blasemedia - I can confirm, it shouldn’t include any symbols but for some reason, it does!

@Danvers, can you help with that?

 

 


I am trying to do something similar but opposite. Transform: 5555555555 -→ (555) 555-5555 

On output it is still giving me 5555555555

Is there a bug in zapier formatter right now?


The output is currently returning the exact same input, so it seems to be a bug in the Formatter.


I’ve also had this bug happen - will flag to the team.

Sit tight everyone.


Thanks @AndrewJDavison_Luhhu !

@Wyatt & @blasemedia I have escalated this to Support and will circle back to update this thread just as soon as they have taken a look!


Does anyone have any ideas for how I might be able to to reformat the phone number using the code step?

I need to do the following:

  • Remove parenthesis
  • Remove spaces
  • Remove hyphens
  • Prepend a 1

Any creative ideas for how I might be able to accomplish this with a different method?

 

Thanks!


@blasemedia - Try this code. It should return 17774445555 for this input (777) 444-5555

const phone = `1${inputData.phone.replace(/e\(\)\- ]/g, "")}`;

output = { phone }];

Thanks @ikbelkirasan 

I am hoping they can update the expected functionality for formatting the phone number as I have dozens of these “in the wild” I would need to hunt down and update.

cc @Liz_Roberts 


I can see that the Support Team came back to you on this and confirmed that it’s an issue with the Formatter. The reason that it’s running into this issue is because the Formatter is looking for a valid phone number (based in the country selected) and if there’s something that doesn’t fit, then it wont format it.

 

We are looking for a way to improve this, and in the mean time, if what you need is to remove all symbols from the phone number, then it looks like @ikbelkirasan has you covered with that brilliant code step!

 

Try this code. It should return 17774445555 for this input (777) 444-5555

const phone = `1${inputData.phone.replace(/p\(\)\- ]/g, "")}`;

output = <{ phone }];