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.


    Nederlandse Hulpbronnen


      • Recent Topics

      • View Answer Bot conversations?

        We are trialing Zia and are experimenting with Answer Bot on our knowledge base. So far so good! Management asks me if it is possible to view Answer Bot conversations, the purpose being to look over its shoulder and confirm that it is working as des
      • Add Comment workflow action delayed by 1–2 minutes in Zoho Desk

        Hello Zoho Support team, We are experiencing an issue with a workflow in Zoho Desk. The workflow is triggered when the Quote ID field is updated and performs two actions: A standard Field Update An Add Comment custom action When the Quote ID field is
      • Zoho CRM Layout Rules: Nine New Actions, Profile-Based Execution, and Interactive Preview

        Hello everyone, Availability: This feature is now available for customers in the JP and SA DCs. It is planned to be released for other customers in soon. We’re excited to announce powerful new enhancements to Layout Rules in Zoho CRM - a feature built
      • Zoho Books and TRAINING SALES receipt label for eTims?

        Hi, Can Zoho Books implement TRAINING SALES receipts and push them to eTims for test? In other words how can we send to Zoho or even create in Zoho training mode invoices and TEST the workflow POS>Zoho Books>eTims and back without actually registering
      • Reporting Tags and COGS

        Is there any way to get COGS recorded against reporting tags? The use cases seems very straightforward to me. If I'm running a P/L report against a specific reporting tag (I use mine for customer type, but it could be used for regions, etc.), the revenue
      • Hide Custom Fields for Customers or Vendors

        For whatever reason, all custom fields added to the Customer module also get added to the Vendor module. This leads to a clunky experience for users, as many custom fields we add only apply to one or the other. There should be a "hide" option to hide
      • Onboarding process

        I urgently need onboarding support. My account still shows trial period.
      • Detailed General Ledger - Display Transaction Description in Reports

        Hi Zoho Team, I'm currently using Zoho Books and have a question regarding the Detailed General Ledger report. When we enter a description or narration in transactions (Bills, Journal Entries, Expenses, etc.), the report does not display this description.
      • Which Zoho CRM tasks would you want an AI assistant to handle?

        I’ve started delegating my Zoho CRM work to AI – and many tasks now take me half the time. It has been so useful that we’re now working to make it available to everyone. Instead of clicking through records and tabs, I simply describe what needs to be
      • Zoho Mail Does Not Integrate with Analytics

        Hello everyone, Just wanted to make a quick post about the problem with zoho mail. Currently it does not connect to Zoho Analytics, which I think is crazy considering both of these applications have existed for a long period of time. Even zoho voice a
      • Net ##th Terms (e.g. due on the following 15th)

        I have a client who pays me twice monthly per our contract. It would be helpful to have terms on my invoices where the invoice is due on the 15th or the 30th of the same or the following month.
      • Project status update visibility within a project

        Currently the only place within Zoho projects to see status updates for a given project is actually not in the project it's self it's in the Collaboration section and then by searching for a given project and clicking on the status tab. It would be great
      • Using custom CRM fields

        I have created a series of fields in the Deals module that need to be linked to fields in a contract I have customized. I can only see how to map standard fields, not the custom ones. How do I do this?
      • Como limitar o Zia Agent?

        Geralmente quando estamos criando um agente de IA no ZIa Agent Studio, colocamos o que ele deve fazer, utilizando as instruções que colocamos no Knowledge Base. Mas como colocamos limites que não devem ser ultrapassados? Para isso utilizamos os Guardrails,
      • An important update for Zoho Cliq desktop users

        The latest version of the Zoho Cliq desktop app (v1.8.0) will no longer be supported on macOS 10.15 Catalina and earlier versions. This is because the framework we use (Electron) no longer supports some older macOS versions. If you’re using macOS 10.15
      • Zoho Flow - Zoho Desk trigger "Ticket created or updated" overrides Department

        Just in case anyone else has this issue. We had a Zoho Flow with the Zoho Desk trigger "Ticket created or updated". In the trigger I had selected a Department (Sales). What happens is that the Department ID (Sales) is submitted as part of the request
      • 2026 Product Roadmap and Upcoming Features

        This is your guide to what is coming in Zoho Vertical Studio throughout 2026. We’ll update this post throughout the year as items move from development to release, and as and when new initiatives are added. Once a feature is released, it will be reflected
      • Introducing Canvas templates: Design once, apply everywhere

        Greetings all! We're happy to introduce Canvas templates, a Forms view enhancement that enables you to design form layouts just once and apply them seamlessly across multiple modules. Imagine you use five CRM modules (Contacts, Deals, Leads, and more),
      • Why cant i see the Campaigns module in my Zoho app

        I am on the ZOHO CRM Standard edition. I can clearly see and use the Campaign module when viewing the ZOHO CRM desktop. When I switch to my phone, the Campaign Module does not show. I have gone through all the settings I can think of, but I still can't
      • 📣 Ask the team behind Zoho SalesIQ: Summer '26 Q&A

        Hi everyone! Following our recent webinars, Summer '26 Release: What's New in Zoho SalesIQ—where we walked you through all the new features, what they do, and how they work—and Driving the AI Evolution: Building Smarter Customer Experiences with Zoho
      • Always display images from this sender – Is this feature available?

        In Zoho mail, I had my "Load external images" setting set to "Ask me", and that's fine. That's the setting I prefer. What's not fine though is I always need to tick "Display now" for each email I get, regardless if I've done that multiple times from several
      • Set Custom Icon for Custom Modules in new Zoho CRM UI

      • Displayed sample tracking for multi branch setup.

        We have multiple branches and one of the biggest challenges for us to be able to track if a particular item is in display or not. I am shooting in the dark but I am wondering if there is a solution for the following : Each product used for display is
      • How do I migrate from Office 365 to Zoho Mail?

        Check out Advik Email Migration Wizard, this software is specially developed to move mailboxes from Office 365 to Zoho Webmail. In addition you can migrate from Gmail, Yahoo, Rediffmail and 80+ webmail servers to ZOHO MAIL. Isn't it amazing? This is an all in one email migration solution. Steps to export emails from Office 365 to Zoho Webmail are as follows; Run Advik Email Migration Tool in your system. Select Office 365 as source and enter its login credentials. Select mailbox folders and choose
      • Connection Issues

        Morning. Seems like a few of my colleagues that are offsite are having issues with connection to cliq, even when their internet is working perfectly fine and only 1 person onsite has issues. Can you please explain? Thanks
      • Backorder process review - Automating Removal of Sales Order from "On Hold" When PO is Received

        Hello Zoho Inventory Team, Currently, sales orders in On Hold status are released only when the bill for the purchase order is created. In our workflow, it would be much more efficient if the sales order could automatically move out of On Hold as soon
      • Which Is the best online store to buy office furniture in Australia ?

        The most important part of your office is the office furniture. Your office is not complete when you have not put the required furniture in place. You need a furniture in your office so that you and your employees have desks, tables, and chairs which
      • Add "Product Code" as available column and search criteria for Assemblies

        Hi Zoho Community. For product (item) assemblies, it would be helpful to be able to create a custom view search criteria that limits the view by product code or perhaps product category. Currently, Product Code is not an available option to display as
      • What's New - July 2026 | Zoho Backstage

        Hello everyone, We hope you’re having an expectation-exceeding event experience! We’ve been hard at work bringing you a bunch of enhancements designed to make event management even easier. Let’s take a look at what’s new in Zoho Backstage. Export delivery
      • Delete Field that is used in a Zoho Flow connection

        I'm trying to delete a Field used in a Webhook created by Zoho Flow with CRM Connection and i get the following alert: When going to the alert i get to the following issue, can't edit it since its been deployed by a pluggin But yes i have here the prompted
      • Q3 USA ZUG Meetups - Build AI Agents with Zoho

        Hi everyone! What if you could build your own AI agent from scratch in just one session? That's exactly what we're going to do at the upcoming ZUG Meetups across the United States, where you'll get hands-on experience with Zia Agents and explore how AI
      • Data Export is forcing Creation/Modified date just like reports

        The data export now forces you to select a created or modified date. There is not an All-Time option. This severely cripples the whole function of data export for audit purposes. If the data export (or reports for that matter), requires a date, there
      • Default ticket template in helpcenter

        Hello, I have a web form and a ticket template created. How can I make that my default ticket template? If an user clicks New ticket or create a ticket, I want that template to be the default one. Thank you for the time and info.
      • Zia Agents looks promising, but I still cannot deploy my first agent or connect WhatsApp after weeks of support tickets

        Hi Everyone, I am posting here because I am stuck and need practical help from someone who has successfully deployed a Zia Agent with WhatsApp. Zia Agents looks like a very promising product. I have watched the platform expand quickly, and I have noticed
      • Valid characters for use in email addresses using Zoho's apps/APIs

        We have found an issue with the + sign character in zoho subs - we are allowed to create a customer with an email address that has a plus sign but the API doesn't allow the + so the billing portal is not created. We are going to prevent users from using
      • Feature Request – Per-Channel Pre-Chat Form Controls

        We'd like the ability to enable/disable the pre-chat form on a per-channel basis, rather than having a single global setting. On the website widget, asking for name and email before chat starts makes sense. On WhatsApp, however, email isn't necessary
      • Copy + Paste in Notes: Text color and text background are not retained

        I've recently started using Zoho Notebook as an Evernote replacement. When copying and pasting text within Zoho Notes, I notice that the formatting of the text (text color and background color) is not retained when pasting. Only the attributes "Bold"
      • Need to show discount before total after subtotal

        Need to show discount before total after subtotal on my estimate template (see attachment)
      • Google Ads Data is Publicly available in Zoho CRM

        We recently discovered that ALL of the following Google Ads fields are visible to all users in our CRM that have access to either Leads or Contacts modules. Not only is this troubling and inconvenient, it should be unacceptable. It also creates a mess
      • Zoho Books bill pay option not available with zoho one

        Why isn't Zoho Books bill pay add-on not available for Zoho one customers not even as a purchasable option. I think this is very inconvenient for companies wanting to use this feature all in one system
      • Next Page