Skip to main content
Question

Format mobile number to Aust style ####[space]###[space]###

  • February 5, 2025
  • 4 replies
  • 23 views

Publicity Princess

Going round in circles with this - how can I format a mobile number in format ########## to Aust format ####[space]###[space]###?

I’m on a Pro plan.

 

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

4 replies

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • February 6, 2025

Hi ​@Publicity Princess 

Try this Zap action: Formatter > Numbers > Format Phone Number

 

Otherwise, you can use a Code step:

const phone = inputData.phone;

// Ensure the input is a string and remove non-numeric characters
const cleaned = phone.toString().replace(/\D/g, '');

// Check if it's exactly 10 digits
if (cleaned.length === 10) {
const formatted = cleaned.replace(/(\d{4})(\d{3})(\d{3})/, '$1 $2 $3');
output = { formatted_phone: formatted };
} else {
output = { error: 'Invalid phone number format' };
}

 


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • February 11, 2025

Hi there, ​@Publicity Princess 👋

How did you get on with that Formatter action Troy suggested? Did it do the trick or did you go with the Code step instead? 

Let us know if you have any questions or need some more help—want to make sure you’re all set! 🙂


Publicity Princess

Thanks for the suggestions Troy but I can’t get either of them to work and so have reverted back to manually adding the spaces to the phone number.

It may be an error at my end but I simply don’t have any more time to spend on this right now. 😕


ken.a
Forum|alt.badge.img+6
  • Zapier Staff
  • February 13, 2025

Hi ​@Publicity Princess 

We completely understand! If you ever want to revisit it, We’d be happy to take another look and troubleshoot with you. In the meantime, if manually adding spaces works for now, that’s totally fine.

Let us know if there’s anything else I can help with! 😊