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

    • Vertical Solution Zoho One

      Hello, is it possible to create a vertical solution for Zoho One? Just like it is possible for Zoho CRM?
    • Important! ZipRecruiter Sponsored Posting Plan Changes in Zoho Recruit

      Greetings, We’re reaching out to inform you about an important upcoming change to the ZipRecruiter Sponsored job board integration within Zoho Recruit. What’s Changing? Starting June 1, 2025, Zoho Recruit will be updated with ZipRecruiter's latest pricing
    • Allowing subqueries in FROM clause

      When building a Query table in Zoho Reports, I encountered an error when attempting to put a subquery in the "FROM" clause of my statement.  Why isn't this currently supported?  Is there a plan to implement this functionality in the future?
    • Managing two books in Zoho Books

      is it possible to effectively manage two separate books within Zoho Books? My organization is considering handling accounting for two distinct subsidiaries, and we would like to understand the best way to achieve this within the Zoho Books.
    • Kaizen #193: Creating different fields in Zoho CRM through API

      🎊 Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
    • CRM for Everyone - More Actions Option to Create Record

      Please consider the option create a new record for the module from the More Actions menu. I know there is an "Add New" icon further down the menu to create a record for any module, but this just seems more intuitive and could reduce the need for the "Add
    • Zoho books partners: Transferwise, Resolut

      Can anyone tell me if Transferwise and/or Resolut (payment systems) are in integrated?  I know PayPal and Google are, but in Europe we like Transferwise and Resolut is an up and coming multi-currency app. Xero and Transferwise are fully compatible. Thanks
    • Multiple workspaces with in Bigin CRM

      As a freelancer working as a sales representative for two companies, each with its own email address, I would like to know if it’s possible to have two separate workspaces in Bigin. This way, I could manage each company and its contacts independently,
    • Fields of Look up in Custom Modules

      We need to create a custom module in Books for Proforma Invoices Now I created a Custom Module and added a Table and in the table added a lookup field and chose Items Now I want Specific fields of the item such as Tax, Item Cost etc but it only displays
    • Ask the Experts 21: Power up your support game with Zoho Desk Automation

      " In every business, there are tasks to automate, Zoho Desk helps with features that integrate Assignments to manage tickets and teams to align,Macros for quick actions and workflows to streamline Contracts and schedules to hold things tight, Plans run
    • Needs Separate Permissions levels for Record Attachments

      Currently in Zoho Books Record attachments are tied to the general permission level For example if a role don't have the delete permission level they cannot delete the attachment as well If a role doesn't have the edit permission they cannot upload the
    • Getting oauth errors on bigin

      Hi Support, I'm getting oauth errors on bigin even though it works fine with CRM. I created a self client which will add contacts. I gave every permission you could and it still didn't work. What should I do. I might just switch to the standard CRM since
    • Sesión "Ask me anything" Zoho en Español - 26 de junio de 2025, de 14:00 a 17:00 (en español)

      ¡Hola Comunidad! ¿Quieres entender mejor Zoho CRM o Zoho Desk? Nuestros expertos estarán disponibles para responder a todas tus preguntas durante nuestra sesión "Ask me anything". Puedes comentar este artículo y durante tres horas, nuestro equipo estará
    • Customer Addresses cannot be edited/deleted in invoices

      In the invoices we have an option to change the customer address and add a new address Now I dont know why for some reason if we add an address through this field, the address doesn't appear in the customer module We cannot delete the addresses added
    • Assessment Field in Custom View

      Zoho recruit finally added the ability to filter Job Applications by Assessment Answers This is a very valuable addition to the Recruit But this is currently missing from the custom view This should be added to the custom view as well
    • Translation support expanded for Modules, Subforms and Related Lists

      Hello Everyone!   The translation feature enables organizations to translate certain values in their CRM interface into different languages. Previously, the only values that could be translated were picklist values and field names. However, we have extended
    • Truesync for Linux

      Is Truesync available on linux ?
    • Subforms and automation

      If a user updates a field how do we create an automation etc. We have a field for returned parts and i want to get an email when that field is ticked. How please as Zoho tells me no automation on subforms. The Reason- Why having waited for ever for FSM
    • Flex Your Creativity – A New component to Canvas in Zoho CRM

      Hello Everyone We’re excited to introduce Flex, a new component for Canvas in Zoho CRM! Flex is here to give you greater control over how your data is displayed in your layouts. This component enables responsive layouts that adapt across different screen
    • When will Sales Order and Invoice Synchronisation with Zoho CRM be Available?

      When will Sales Orders and Invoices, created in Zoho Books or Inventory be made available in Zoho CRM? John Legg Owner: The Debug Store
    • Feature Requests and enhancements: Subform

      By The Grace of G-D. Hi, It would make it much easier to use if we could have some more features in subforms: More Columns/Fields Set the size of a column Show the subform in Full Page Width Sorting By Column Please consider The above suggestions. T
    • Clone a Module??

      I am giong to repurpose the Vendors module but would like to have a separate but very similar module for another group of contacts called Buyers. I have already repurposed Contacts to Sellers. Is it possible to clone (make a duplicate) module of Vendors
    • 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
    • Unapplied AP Credits not showing up on AP Detail Aging

      I am new to using Zoho Books. I was reconciling some accounts and found differences from the GL balance and AP Aging and it came down to unapplied vendor credits. Is there an option to include that on the report, so I can pull a matching AP Aging to the
    • Add Entry and Subform Record from Deluge Scripts

      Hi all,  I would like to know how do I add a new entry and also subform records from a deluge scripts.  I can use the insert into to add a new entry to a form, but how do i insert a collection into the subform of the entry? I am using a deluge script
    • i keep see there is a connetion issue connecting 3rd party api on zoho when using zia

      hi there , i have set up open ai api to zoho zia (copied and pasted to zoho zia) but I keep getting notificaiton "there is a connetion issue connecting 3rd party api on zoho" when using zia on top when click zia and try to type in word there
    • Finding draft ticket replies

      Is there a way to see all tickets which have draft replies?
    • How to apply a tag to a ticket based on the to email address?

      I need to assign a tag to a ticket if the ticket was sent to a specific email address. For example, we have the email accounting[at]company.com forwarding into Zoho Desk. We would like all emails that were sent to this address to be tagged with an Accounting
    • Engineering Change Order Process using Tickets?

      Hi Zoho Community, I'm working with my company to create an Engineering Change Order/Request (ECO/ECR) process where engineers can internally create tickets for changes in a product that must be reviewed, approved and implemented by people or teams in
    • Allow Changing Appointment Status from "Completed" to "No Show" or Other Valid States

      Hi Zoho Bookings Team, We hope you're doing well. We would like to submit a feature request regarding appointment status management in Zoho Bookings. 🎯 Use Case Sometimes, an appointment is mistakenly marked as Completed, but later we realize that the
    • How can I move a ticket from Department A to Department B?

      Hi there, how do I move ticket from Department A to Department B? I went in the ticket and tried to scroll down the menu under the "department" but it won't let me, I am a support admin. Did I do anything wrong? or am I doing it in the wrong place?
    • Validation Rules Trigger on Untouched Fields

      In Zoho Desk, validation rules trigger for ALL fields during an update—even fields that weren't modified in the current edit. This behavior is fundamentally different from Zoho CRM and other Zoho products, where validation rules only apply to fields actually
    • How to work with getFieldNames formdata functions ,Any Examples

      I don't find any example showing usage of getFieldNames. Where do i find .is there any Help documents available
    • Zoho Notifications - Received two notifications for one message and none for the other

      We had a client reply to a ticket twice in one minute. The ticket owner received two emails for the second message but none for the first (which was crucial content and unfortunately was therefore missed). I'm assuming this created a race condition -
    • Can we have Backorder Management ?

      Can we have Backorder Management ?
    • Better integration between Zoho CRM and Zoho Bookings

      I've noticed that when a meeting which was created in Zoho Bookings is updated by a sales person in Zoho CRM, the change is not reflected back into Zoho Bookings. I have raised this with support who advised that meetings created in Bookings need to be
    • What is the difference between "Reply" and "Public Comment" in a ticket?

      Hey, my company is thinking about switching to Zoho Desk but we do not understand the difference between the "Reply" and the "Public Comment" feature. When should we use which? And why? What is the difference between them? Thank you for your help! Kindest
    • Tasks View for Opportunity/Jobs does not indicate "Related To" account

      How can ZoHo be setup so that when a task is created for an Opportunity, the subject automatically lists the underlying account? Right now, it's impossible to link the Account to the task when the task is created from the Job.  Therefore, the open task view is inadequate.  And it's a lot of maintenance to have to manually add the account to the subject...defeating the purpose of "Automated" workflow. 
    • Writing SQL Queries - After Comma Auto Suggesting Column

      When writing SQL Queries, does anyone else get super annoyed that after you type a comma and try to return to a new line it is automatically suggest a new column, so hitting return just inputs this suggested column instead of going to a new line? Anyone
    • can i show alert when i finish running the function?

      how i can show alert inside the custom function or popup notification. when i use alert inside the custom function it show this error Error at line number:  2 'ALERT' task can be used only in on load, on validate and on change actions ​
    • Next Page