Join The Community Sign Up For Club Zenatta

Article Read Time:

3 Min

Stay Connected

Assigning Leads to Salespeople Fairly With Zoho CRM Automation

Assigning leads can be a tricky political business. How do you distribute leads fairly so that everyone has the same opportunity to thrive and make money without showing favoritism or giving valuable leads to poor performers? Most organizations settle on a random or semi-random method to avoid any appearance of preference or punishment.

Absent any other lead assignment process, a sequential or “round-robin” lead assignment process tends to be fairest. If you’re unfamiliar with this method, you mainly cycle through a list of your salespeople. After a lead is assigned to the salesperson at the top of the list, they’re moved to the bottom of the list. Then, the next lead is assigned to the new top salesperson. This process repeats itself until there are no more leads to be assigned.

Automatically Assigning Leads Sequentially with Zoho CRM

Because Zoho CRM can’t support this process by default, you’ll need to create a custom function. These functions use custom code to execute specific actions and update CRM records based on various attributes. Zoho CRM uses the Deluge scripting language for custom functions. Zoho Creator can help you build custom Deluge functions, or you can access online libraries of scripted code from Zoho or third-party sites.

Here’s how you add an automated round-robin lead assignment to your Zoho CRM.

Prerequisite: You must create a permanent record in the Leads module and assign that record to the first user in round-robin function. Either use an existing lead, or create a dummy lead and assign it to your first user. The function won’t work properly if you don’t create a permanent record.

  1. Navigate to Setup > Automations > Actions > Functions > Configure Function > Write your own.
  2. Name your new function.
  3. Set the module as Leads.
  4. Copy the code included on Zoho’s website
  5. Edit your code to replace the following placeholders:
    • Change the ‘xxxxxxxxxxxxxx’, to the User ID of the specific
    • Assigning to a user requires the User ID and not the user name. The user ID is found on the Setup page of your CRM. Take a look at the screenshot below for more details.
  6. Click Edit arguments.
  7. Name the argument leadid and set its value to Lead Id.
  8. Click Save & Execute Script.
  9. Save your changes.

This code will only work in the Leads module as written. However, you can modify the code to work on other modules, if you prefer.

Assigning Leads Based on Working Hours

You can also use a similar process to assign leads based on shift timing. Because the vendor that replies to an inquiry first typically wins the majority of the business, your sales team must respond to incoming inquiries promptly. Thus, you’ll want to assign inbound leads to sales reps that are presently working at the time of the inquiry.

To assign leads based on shift timing, you’ll use the same steps as above, but with a slightly different operational code. Follow this link to find Zoho’s code for assigning leads by shift timing. Then, use this code in place of the code referenced in Step 4, keeping all the other steps the same.

Auto-Assigning Leads Based on Record Attributes

With a different workflow, you can assign leads based on their attributes. For example, if one of your account managers is responsible for a certain industry, you’d want to send them all the new leads from that industry. 

Just about any information contained within a Zoho CRM record can be used to establish the conditional logic used by your Workflow to assign the lead. 

To take advantage of this flexibility, create a workflow that triggers on the creation of a new lead and assigns it based on the CRM record parameter you wish to analyze. It helps to use a required field since Workflows don’t typically trigger when their criteria field is blank.

Billy Bates

Senior Web Developer

Billy is a Wordpress Developer with an eye for design. His knowledge will help our company website and client sites meet their goals. Billy and his young family have just moved to Ashland Oregon, and are looking forward to exploring the area’s amazing beer, wine, and food. He also has a passion for synthesizers and drum machines.

Lucas Sant'Anna


With a background in Operations Research and Data Analysis, Lucas is a Brazilian programmer that likes to get stuff done quickly and reliably. In previous jobs, he implemented industrial job scheduling, fleet management and detailed long-haul route optimization – among other data-driven processes – to reach objectives of increased profit and reduced wasted resources. His goal is to make Zoho fully automated and with more meaningful data for spot-on decisions.