Skip to main content
Question

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


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.

 

Did this topic help you find an answer to your question?

3 replies

Troy Tessalone
Forum|alt.badge.img+14

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
  • 7289 replies
  • 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. 😕