Best answer

Formatter Tool: Issue With Formatting Phone Number... What Am I Doing Wrong?

  • 9 April 2020
  • 9 replies
  • 1689 views

Userlevel 2

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

 

icon

Best answer by Danvers 27 April 2020, 18:07

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

9 replies

Userlevel 7
Badge +12

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

@Danvers, can you help with that?

 

 

Userlevel 1

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?

Userlevel 7
Badge +12

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

Userlevel 7
Badge +10

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

Sit tight everyone.

Userlevel 7
Badge +8

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!

Userlevel 2

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!

Userlevel 7
Badge +12

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

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

output = [{ phone }];
Userlevel 2

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 

Userlevel 7
Badge +12

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(/[\(\)\- ]/g, "")}`;

output = [{ phone }];