Custom Function to Format Phone / Mobile numbers in Australian Standard format

Custom Function to Format Phone / Mobile numbers in Australian Standard format

So I got sick of phone numbers being formatted incorrectly and Zoho not doing anything to standardise phone numbers to meet E.164 formats. So I went and coded my own function to fix this.
And figured I'd share with the community

This is specifically for Australian numbers. 

The CF will take all mobile, local landline, 1800 & 1300 numbers and format them into the format we are used to in Australia.
It will also add the country code +61 to the prefix so you can call directly from the CRM.

It works with all 10 digit numbers (0400 000 000 or 03 9000 0000)
And with all 9 digit numbers (400 000 000 or 3 9000 0000)
IE works with both the starting 0 or without the starting 0 (ie 03 9000 1111 or 3 9000 1111)


The numbers will be formatted as below


All mobile numbers    0400111222 --> +61 400 111 222
                                       400111222 --> +61 400 111 222
All local numbers        0390001111 --> +61 3 9000 1111
                                       390001111 --> +61 3 9000 1111
1800 numbers            
1800111222 --> +61 1800 111 222
1300 numbers            1300111222 --> +61 1300 111 222

For the local numbers it will work with all states area codes (02, 03, 07, 08)

Anything that isn't the above will be ignored and stay the way it was. IE 131122 will stay like that
As will any numbers that aren't 9 or 10 digits long. (ie +61400111222 wont be formatted with spaces)

**NB I may do a V2 to format numbers that are +61 already but not planning that for a while.

This function is specifically for the Leads module.
It is Phone/Mobile Field agnostic. In that it will take whatever value is in the Phone Field, format it return it to the Phone Field. and what ever is in the Mobile Field, format and return it to Mobile Field.

I did this specifically as we use Phone to be the contacts Primary contact number and Mobile to be their Secondary contact Number.

It should be pretty easy to adapt to Contacts Module or any other module. You only need to change line 1 & 211.


Setting up with Workflow and Triggering the Function:
This applies for CRM
  1. Go to Setup --> Automation --> Workflow Rules --> Create Rule --> Under Module, select Leads --> Give a Rule name and Description (ie Format Phone Numbers Australia) --> Next
  2. When = Select "On a Record action" --> "Create or Edit" --> Next
  3. Condition = In Conditions, choose "All Leads" --> Next.
  4. Instant Actions --> Function --> New Function --> Write your own --> Add a Function name (ie Format_Phone_Numbers_Au), Display Name (ie Format Phone Numbers Australia), Description --> Create
  5. Copy paste the code from below and proceed to save the code.
  6. "Edit the Arguments" --> Key is id, in Param Value type # and choose your fields (ie Leads and Lead Id) the end result should read id = Leads - Lead Id --> Save
  7. Save the Function 
  8. Save the Workflow.


NOTE: there is probably a better more efficient way of achieving this.
So if anyone know a better way to code the above I'd love to hear.

EDIT: I had to upload the code separately due to restrictions in the post lengths.

EDIT 2: now updated to work with brackets (03) 9000 1111 and hyphens 0400-000-000

EDIT 3: updated to work with the country code already added but no + ie 61400111222  


The number formatting will work with the following

All mobile numbers    --> +61 400 111 222
  1. 0400 111 222
  2. 400111222
  3. 0400-111-222
  4. 61400111222
All local numbers  --> +61 3 9000 1111
(works with 02, 03, 07, 08) 
  1. 0390001111                  
  2. 390001111
  3. (03) 9000 1111
  4. (03) 9000-1111
1800 numbers  --> +61 1800 111 222
  1. 1800111222
  2. 1800 111 222
1300 numbers  --> +61 1300 111 222
  1. 1300111222 
  2. 1300 111 222 


EDIT: May 2025

Theres been some requests about cleaning up existing phone numbers for leads/contacts.

To do this there are a few steps to do.

Step 1 - create a new Custom Function called "Format Phone Numbers Au - mass update"
(or what ever you want to name it)

Use the same code as the single run fuction and add a recurring "loop" section to the start of the code, and a small closing at the end.
The way I have it setup is to use the following opening code before Line 1. 
Line 6 of the below code replaces Line 1 in the full code.

  1. string button.Format_Phone_Numbers_Au_mass_update(String leadIDs)
  2. {
  3. idList = leadIDs.toList("|||");
  4. for each  rec in idList
  5. {
  6. a = zoho.crm.getRecordById("Leads",rec);

Then to close the function replace the final Map (line 208-213) with the following

  1. }
  2. mp = Map();
  3. mp.put("Phone",nph);
  4. mp.put("Mobile",nmob);
  5. update = zoho.crm.updateRecord("Leads",rec,mp);
  6. info mp;
  7. info update;
  8. }
  9. return "Success";
  10. }

This new function will take your selected list of Leads and then "for each Record in the idList will run the function"

Step 2 - Create a Mass Update Button in the List view of the Leads/Contacts Module

Go to Settings > Customizations > Modules and Fields > [Module Tab} > Leads
Then go the the Buttons tab > Create New Botton

Button Name: Phone Numbers Mass Update
Define action: Function
Select Page: In List
Select Position: Mass Action Menu  (preview to see where the botton will be placed)
Configured Function: Select the function you created in the above step

Doing the above will create a new botton in the main list view for the Module. 
To use the button you need to select the entries you want to run the function then click the button.

Step 3 - Create a custom View for your Leads/Contacts so that you have less than 1000 

Zoho CRM Limits mass update functions to run for max of 1000 entries at a time. So if you have 10,000's leads you need to figure out how to narrow your view down to less than 1000 entries.

One way is to create a View with specific criteria like 
Email starts with A - this will show all leads with email address beginning with A
If this is still more than 1000 then figure out how to reduce it further to less than 1000

Step 4 - Select all records
Select the check box of the view at the top of the Column. This will select all records in the current window.
Windows are limted to 100 records, so you need to select all 1000 
You will then see a Blue text option to "Select All records in this view". Click this and all records will be selected.
If you have more than 1000 records in the view you wont be able to do the following step so make sure you've limited the view.

Step 5 - click the Mass Update button

Click the Mass Update Button you created above in Step 2. This will run the fuction for all the entries.
It'll take some time and entries will be added to the execution que. If you are interested you can check the api usage to make sure you keep your usage under the daily limit.

Step 6 - Figure out how to vary your list View for the next batch

Rinse and repeat Step 3-5. 
Figure out how to change the View so you see the next 1000 batch but exclude the ones you have already done.

Step 7 - Finish

Make sure you remove the Button you created in Step 2, otherwise someone will definitily run it in future when you dont want them to.


    • Recent Topics

    • Quoting Subscriptions with one Time costs

      Hello all, We sell a subscription SaaS service for which we provide one-time services for implementation and customization. Using CRM quotes i was able to create customized total fields to show the total one-time costs, monthly cost, total subscription
    • Add the ability to view number of hours planned for a workorder while in the Dispatch Console

      Hi Zoho, When dispatching a work order through the Dispatch Console, there's currently no way to view the number of planned hours for the service tasks associated with that specific work order. Having to click into the details each time to check planned
    • Customer Payment

      Seprate voucher required for cash and bank .You can not authorized any one to enter cash payment .In statement clearly shown is it bank receipt or cash recipt .
    • how to add previous month purchase bill and claim ITC

      Hello we have a unclaimed ITC bill of April (we didn't claim it in may as seller didn't uploaded his gstr1 ) when we trying to file gstr 3b in june month we noticed the bill has been uploaded (april bill) .how to change the filing month of that april
    • Deluge security enhancements

      Hello everyone, At Deluge, security is a top priority, and we're continuously working to enhance the platform's safety and reliability. As part of our ongoing commitment to secure coding and industry best practices, we're rolling out key updates to how
    • Sync desktop folders instantly with WorkDrive TrueSync (Beta)

      Keeping your important files backed up and accessible has never been easier! With WorkDrive desktop app (TrueSync), you can now automatically sync specific desktop folders to WorkDrive Web, ensuring seamless, real-time updates across devices. Important:
    • Outlook 2013 Calendar Syncs but "Related To" Field in Zoho is blank

      Outlook 2013 Calendar Syncs but Related To Field in Zoho is blank I expect the "Realted To" field to be populated with the calendar participants
    • How do I set users up to only send emails using org emails?

      We run marketing campaigns for multiple clients and strictly send emails using the official organization addresses provided by each client. However, we've encountered several instances where users unintentionally send emails from their own company accounts—a
    • Empowered Custom Views: Cross-Module Criteria Now Supported in Zoho CRM

      Hello everyone, We’re excited to introduce cross-module criteria support in custom views! Custom views provide personalized perspectives on your data and that you can save for future use. You can share these views with all users or specific individuals
    • open multiple notes at a time.

      Hey there, New to Notebook and liking it, but one thing that's really a bother is not being able to open more than one note at a time, either in a new window or in a new tab. Often times, I like to copy/paste from one note to another or compare drafts
    • Let’s Talk Recruit: Forms that think before you do!

      Welcome back to our Let's Talk Recruit series. In our previous post, we shared highlights from our community meetups held across India. This time, we’re talking about something that often gets overlooked but makes a huge difference once you set it up
    • Zoho Reports Not Grouping from Subforms

      I have created reports from a subform. We have a budget from a standard field, and the bills added to a subform. I've summarised the bills in a field. In edit mode, the bills are joined per supplier, which is what we want. But then it converts and separates/duplicates
    • PEPPOL Support Needed for Zoho Books in Europe

      I'm reaching out to discuss the urgent need for PEPPOL support in Zoho Books for European users. With Belgium mandating B2B e-invoicing via PEPPOL starting in 2026, many of us are struggling to manage invoices without this integration. While Zoho Books
    • Allow Equity Accounts to be Used for Expenses

      Currently, when entering an Expense or Bill, the Expense Account (account to be debited) allows for accounts in any of these categories to be chosen: COGS Expense Other Current Liability Fixed Asset Other Current Asset Noticeably missing are Equity Accounts.
    • メール一括配信の未送信のメールについて知りたい

      メール一括配信の後の、未送信のメールの数は添付のようにシステムから連絡がくるのですが それらの対象者を知りたい。レポートなど一覧で知りたい。 また配信対象者なのに(担当者、リード)の メールの履歴に配信したメールの件名でさえ表示されないのはどう理解したらよいのか知りたいです。 また、これらの人をレポートで一覧で出す方法を教えてください。把握したいためです。
    • How do I add the time zone for the each recipient/subscriber

      Hi, I've read that Zoho allows for emails to be sent at a certain time based on the recipient's time zone. How do I add the time zone for the each recipient/subscriber? Thanks!
    • Zoho Projects - Q2 Updates | 2025

      Hello Users, With this year's second quarter behind us, Zoho Projects is marching towards expanding its usability with a user-centered, more collaborative, customizable, and automated attribute. But before we chart out plans for what’s next, it’s worth
    • low quality videos

      when in puplish videos or reel in social media platforms it pulished in low quality
    • Find and Merge Duplicates to trigger webhook

      My sales team uses the Find and Merge Duplicates feature often to cleanup records in the CRM. We use webhooks to signal to our internal tools database when new Contacts are created, updated, or deleted, in order to keep our DB in sync with Zoho CRM. However,
    • [Important announcement] Zoho Writer will mandate DKIM configuration for automation users

      Hi all, Effective Dec. 31, 2024, configuring DKIM for From addresses will be mandatory to send emails via Zoho Writer. DKIM configuration allows recipient email servers to identify your emails as valid and not spam. Emails sent from domains without DKIM
    • Marketer’s Space: Using Zoho CRM Data for Dynamic Content and Personalization in Zoho Campaigns

      Hello Marketers! Welcome back to Marketer’s Space. Do you want to send emails or SMS that feel less like mass messages and more like one-on-one conversations? By integrating Zoho CRM with Zoho Campaigns, you can pull in rich customer data and use it to
    • Change start time after starting the timer

      Hello Projects Community, an amazing feature would be to change the start time of a running timer. I know this from some other time tracking softwares. Any idea about this? Best wishes Niels
    • I can't found API for Sales Receipts

      Hello May you please help me to find an API document for Sales Receipts to get data and retrive a custom fields like Invoice and credit notes Regards
    • Delete my store of Zoho commerce

      Hi Team, I want to delete my stores of commerce. Please help me asap. Looking for the positive response soon. Thanks Shubham Chauhan Mob: +91-9761872650
    • Add Attendees to Session months before the Event

      I need to manually add Attendees to Sessions right away for an event that's taking place in 6 months so that the Speaker can communicate with them in advance of the event. How can this be done?
    • Extensions 101 webinar series: Build, integrate, and monetize with extensions

      Attention developers! Are you ready to take your extension development skills to the next level? We're excited to bring back the Extensions 101 webinar series with an expanded lineup of Zoho products and an introduction to more platform features. Last
    • Override Auto Number field?

      We are preparing to migrate from Salesforce. In Salesforce, we auto-generate a unique number on our Opportunities (Potentials). If the Opportunity results in a contract, we use that unique number as the Contract number. There are some situations where
    • Zoho Books | Product updates | July 2025

      Hello users, We’ve rolled out new features and enhancements in Zoho Books. From plan-based trials to the option to mark PDF templates as inactive, explore the updates designed to enhance your bookkeeping experience. Introducing Plan Based Trials in Zoho
    • Zoho Recruit > Email Templates

      Dear All Background: We are using Zoho Recruit for the 4 business units under our group of company it our posting our of Job it will be done via our internal recruiter. In the Email templates, i want to be able to insert the individual business unit,
    • Unapproved Leaves are hard to distinguish in Attendance View

      This is a an unapproved leave request It appears in the Attendance view without any visual indicator if its approved or not For a whole day request this might be manageable but for hourly requests it gets very hard to know which are approved, which are
    • Client Script Quality of Life Improvements #1

      Since I'm doing quite a bit of client scripting, I wanted to advise the Zoho Dev teams about some items I have found in client script that could be improved upon. A lot of these are minor, but I feel are important none-the-less. Show Error on Subform
    • Communicating with emojis

      On July 17, we celebrate World Emoji Day! We're a bit late 😐 sharing insights about this day. But we just couldn't let it pass without a mention 😊 because emojis have a meaningful connection with customer service 💬 🤝. We do not want to miss out on
    • GA4 data

      Hi, I have data being pulled from GA4 into numerous tables. There are a few major errors in the source data. Eg for a period of time GA4 reported ecommerce sales that were $98 as $9,800 and $42 as $4,200. It's not happening now but my historical data
    • 5名限定 課題解決型ワークショップイベント Zoho ワークアウト開催のお知らせ(7/24)

      ユーザーの皆さま、こんにちは。Zoho ユーザーコミュニティチームの藤澤です。 7月開催のZoho ワークアウトについてお知らせします。 2ヶ月ぶりに、渋谷にて「リアル開催」します! ▷▷詳細はこちら:https://www.zohomeetups.com/20250724Zoho ━━━━━━━━━━━━━━━━━━━━━━━━ Zoho ワークアウトとは? Zoho ユーザー同士で交流しながら、サービスに関する疑問や不明点の解消を目的とした「Zoho ワークアウト」を開催します。 Zoho サービスで完了させたい設定やカスタマイズ、環境の整備など……各自で決めた目標達成に向け、
    • Switching hosts while meeting is occuring

      We had a team meeting in Zoho Meetings this morning, but the person listed as the host had to leave the meeting early. We looked for an option to set me to host, but didn't see the option, and we incorrectly assumed that it would be like Zoom in that
    • Introducing Assemblies and Kits in Zoho Inventory

      Hello customers, We’re excited to share a major revamp to Zoho Inventory that brings both clarity and flexibility to your inventory management experience! Presenting Assemblies and Kits We’re thrilled to introduce Assemblies and Kits, which replaces the
    • Refund Form Can’t Reverse “Bank Charges” Line — Throws Off Reconciliation

      Zoho, When we pay a vendor, the Payment screen lets us add a “Bank Charges” amount (we post a $1 processing fee there). Perfect. But on the Refund popup there’s no matching field, so the refund can only return the net expense. If our processor sends back
    • Client Script | Update - Introducing Subform Events and Actions

      Are you making the most of your subforms in Zoho CRM? Do you wish you could automate subform interactions and enhance user experience effortlessly? What if you had Client APIs and events specifically designed for subforms? We are thrilled to introduce
    • Zoho Integration with UPS

      I have 2 questions: Firstly, is there a way to notify UPS that we have a package to collect once we have done the shipping label? Secondly, how do I get the tracking number and shipment method onto the Invoice and Package Slip for the customer? Than
    • Why don't we have better integration with Mercado Pago or Pagseguro?

      Currently, the integration between Zoho Commerce and Mercado Pago for Brazil is very poor... Since it is old, it does not include the main payment method in Brazil today, which is PIX. Is there a date for this to finally be launched? There are numerous
    • Next Page