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

      • Marketing Tip #26: Optimize product images for SEO

        Product images can do more than make your store look good. They can also help customers discover your products through search. Since search engines can’t "see" images, they rely on text signals to understand what an image is about. Two small actions make
      • Automation Series: Mandatory Time Logging Before Task Closure

        In a project, when users work on multiple tasks simultaneously, they track time in different ways, either by starting a timer or by adding a time log. Sometimes users may forget to add time, which can lead to discrepancies in the timesheet. When timesheets
      • Is there a way to show contact emails in the Account?

        I know I can see the emails I have sent and received on a Contact detail view, but I want to be able to see all the emails that have been sent and received between all an Accounts Contacts on the Account Detail view. That way when I see the Account detail
      • Zoho CRM gets a new email compose and lot more

        Dear Customers,  [UPDATE October 21, 2021: We have started opening these features to some of the customers already. And, it will be available to all the customers before November 2nd Week, 2021. Sorry for the delay caused]  [UPDATE February 21, 2022:
      • Custom AI solutions with QuickML for Zoho CRM

        Hello everyone, Earlier, we introduced Custom AI Solutions in CRM that let you access QuickML for your custom AI needs. Building on that foundation, we’ve now enabled a deeper integration: QuickML models can be seamlessly integrated into CRM, and surface
      • CRM gets location smart with the all new Map View: visualize records, locate records within any radius, and more

        Hello all, We've introduced a new way to work with location data in Zoho CRM: the Map View. Instead of scrolling through endless lists, your records now appear as pins on a map. Built on top of the all-new address field and powered by Mappls (MapMyIndia),
      • Introducing document visibility in Zoho Sign

        Hello! Complex document workflows often involve multiple stakeholders with different roles. Sending a separate envelope to every person is time consuming and can lead to administrative bottlenecks. With Zoho Sign's document visibility feature, you can
      • Sent email stuck on processing

        My sent emails are stuck on processing, whats going on?
      • [Webinar] What's new in Zoho Analytics: Q2 2026

        Hey data lovers! Our What's New webinar series is bringing you another lineup of exciting features and product enhancements from the past quarter, all designed to help you get more out of your analytics. Get an inside look at new data connectors, Zoho
      • Alterar número de telefone para receber o código OTP

        Boa tarde! Como posso alterar o número de telefone da minha conta para aceder ao meu email corporativo? Estou tentando logar, mas não consigo, pois está sendo enviado o código OTP para o número antigo, preciso aceder urgente meu email, porque e de trabalho.
      • CRM x WorkDrive: We're rolling out the WorkDrive-powered file storage experience for existing users

        Release plan: Gradual rollout to customers without file storage add-ons, in this order: 1. Standalone CRM 2. CRM Plus and Zoho One DCs: All | Editions: All Available now for: - Standalone CRM accounts in Free and Standard editions without file storage
      • Request to Increase URL Field Character Limit

        Hi Arthi, Hope you are doing well. I'm trying to save a URL in the Work Order (WO) module using the URL field, but I receive the following error message: "Please enter a valid Repair File. Maximum 450 characters are allowed." The issue is that the URL
      • How to change column headings in pivot table?

        Hi, Is there a way to rename the column headers of a pivot table? Now some the columns are named with value labels: 'SUM of .....'. We would like to rename those headers. As of now we couldn't find any direct solution to adjust the headers, besides copying and reformat. We want to avoid these extra steps. Best, Tiemen
      • Undelivered Mail

        I suspect that there are recipient's servers that blocks my emails. I receive the following email from mailer-daemon@mail.zoho.eu : A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. pantelis.sarantos@unipakhellas.gr,
      • Email not loading on PC

        Hello, my email opens on but it doesn’t load on PC. I don’t have other issues with the email, all the configurations are ok and I face with following issue in the photo. It says “ mail.zoho.com refused to connect” I will be very thankful if anyone can
      • Why are bounce/error emails being sent to info@ instead of contact@?

        I have my Zoho Mail and WordPress site configured so that normal website emails should go to contact@hybridbatteryservice.com. However, I keep receiving technical bounce/error emails and delivery failure notifications at info@hybridbatteryservice.com
      • Do Not Disturb status not respected when Cliq bar is enabled across Zoho apps

        Hi Zoho Cliq team, I want to report what appears to be a bug with how the Do Not Disturb status interacts with the embedded Cliq bar in other Zoho apps. **Issue:** When my Cliq status is set to Do Not Disturb, I continue to receive notification tones
      • Zoho Webinar Summer Broadcast 2026

        What if your webinar platform could connect directly with your business tools, automate routine tasks, trigger actions across your workflows, and support every stage of your webinar lifecycle? That’s the question we’ve been answering so far this year.
      • 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
      • Invalid request when trying to access Mail

        When I click on the red button to access Zoho Mail at https://mail.zoho.com/zm/, I get a big yellow warning triangle with "invlid request, The input passed is invalid or the URL is invoked without valid parameters. Please check your input and try ag
      • Whats the average response time for ticket submitted?

        I submitted a request to unblock my mail accounts. They seem to be blocked for outgoing mail, and I have been waiting for days to have this fixed with no reply. I have submitted 2 tickets and an email. My work has to completely stop. I pay for the service
      • All new Address Field in Zoho CRM: maintain structured and accurate address inputs

        Availability Update: 29 September 2025: It's currently available for all new sign-ups and for existing Zoho CRM orgs which are in the Professional edition exclusively for IN DC users. 2 March 2026: Available to users in all DCs except US and EU DC. 24
      • Is there any way to have Dataprep ingest RSS?

        As stated by the title. Does the Zoho environment offer tools that I can use to, directly or using workarounds, have Dataprep ingest an RSS feed? Thanks
      • Introducing Color Coding of Picklist Values

        Dear Everyone, Greetings!! Zoho CRM is uplifting the user experience. Recently, we had some notable aesthetic improvements in CRM like Kanban View UI enhancement, New List view UI enhancement, color coding of tags, and color coding of picklists in meetings.
      • Important updates to your Widget JS APIs

        Hello everyone, Greetings from Zoho Creator! This is an urgent notice for developers and Partners who use widgets in their Zoho Creator applications. We previously announced an update to the CDN URLs used for loading the Widget JS API, with a deadline
      • Deluge sendmail in Zoho Desk schedule can't send email from a verified email address

        I am trying to add a scheduled action with ZDesk using a Deluge function that sends a weekly email to specific ticket client contacts I've already verified the email address for use in ZDesk, but sendmail won't allow it in its "from:" clause. I've attached
      • Mailbox delegation “Send As” error

        I believe there may be an issue with mailbox delegation. When I create a delegation from the Admin Console, it works correctly if I select Read permissions. However, if I select Send As permission for the delegated user, I immediately receive the following
      • Restrict Zoho Cliq Webinars and Announcements to Admins Only

        Hi Zoho Team, We hope you're doing well. We would like to raise a feature request regarding in-app announcements in Zoho Cliq, such as the recent webinar popup about the Cliq Developer Platform: While these announcements are useful, they are not always
      • how do i get mail.mydomain.com to point to zoho mail web-mail?

        I have started using zohomail, and am loving it. With my previous provider, I used to go to mail.mydomain.com, and it would take me to my webmail. I am not able to find the mapping for zoho's webmail to map to it. It is difficult to go to webmail with
      • Number of decimal places

        Hi Latha, I have added the following three fields to the Company module. Currently, these fields only allow a maximum of 2 decimal places. However, for some of our requirements, we need to enter values with up to 10 decimal places. Could you please help
      • zoho imap connection stopped working 05/28 12pm EST

        Hi, beginning Thursday, 5/28, ~12 pm est imap to siteground stopped working. When I tried to reconnect the account, connection was failing with the following message: Unable to connect SMTP server:gvam1107.siteground.biz, Port: 587. I did notice that
      • User Name in Zoho Cliq Not Updating Across Apps?

        We updated the name of a user in Zoho. (From Sue to Taylor) Her name has not been updated in Cliq on all apps. When in Zoho One, if I go to Cliq directly, it is correct, but if I am in another app, and the Cliq bar pops up on the bottom, it will be the
      • Service currently unavailable

        The Zoho Mail Webmail is working, the Mail Admin Console is not: "Our service is temporarily unavailable, please try after sometime." How long must I wait to retry? edit: To add to this, the Webmail is not working 100% - I can open mail in the inbox,
      • Service currently unavailable

        Service currently unavailable It is not possible to access email; the entire Zohoworkplace platform is down
      • User Permission Log

        Our external auditors are asking for a way to view changes made to user permissions (basically, a user permission change log). Is this feature built into Creator? 
      • E-mail down

        We cannot get into our email inboxes, are you affected by a Microsoft update issue? How long do you think as to restoration?
      • ZOHO MAIL SERVICE NOT WORKING

        Hello i've a problem my zoho mail account says a display with this text "our service is temporally unavaible"
      • ايميل مجانى

        Can I create a free email account on Zahoo?
      • Sign up for email for a domain

        Hi - I thought I had signed up for a domain of <domain>.com, but only see the email of @zohomail.com . How do I get the <domain.com> domain linked to my email?
      • Feature Request: Include Creator-applicable Deluge updates in the Creator Release Notes

        I'd like to put forward a suggestion about how Deluge updates are surfaced to Zoho Creator developers, and I'm hoping the Creator team will consider it. Zoho Creator is built on Deluge. Every workflow, custom function, validation and schedule we write
      • Next Page