Print this page

How do I create a round-robin assignment for Leads or Cases to users?

Knowledge Article Number 000004000

How do I randomly assign Leads or Cases to users?


To assign leads (or cases) that are either manually created or created using Web to Lead (or Case). Follow the instructions below:

The first steps for lead or case assignment is to create two custom fields that can be included in the page layouts for users or hidden as they are strictly for the assignment mechanism based on the custom formula. The instructions below assume the setup is for leads.


1. Create an auto number field in leads called "Lead Number" that spans 0 decimal places and had the format "{0}" (exclude the inverted commas). Below are the steps to create Auto number field:

a) Click on Setup | Customize | Lead | Field.
b) Scroll down and click on “New” button on “Lead Custom Fields & Relationships”.

c) Scroll down and select “Auto Number” radio button.Enter “Field Label” (eg – Lead Number) with that spans 0 decimal places and had the format "{0}" (exclude the inverted commas). 
d) Click on Next for “Field-Level Security for Profile”Click on “Save” to include it different Page Layout Name.

2. Create a custom formula field with return type number in leads called "Round_Robin_ID" and use the formula:

MOD(VALUE(Lead_Number__c) ,3) +1

3. Use the value of this formula field in your lead assignment rules to assign lead records to different queues or users:

Round_Robin_ID = 1 is assigned to Queue A (User 1)
Round_Robin_ID = 2 is assigned to Queue B (User 2)
Round_Robin_ID = 3 is assigned to Queue C (User 3)


Explanation of the process:

The following formula example for leads assumes you have 3 lead queues and you want to assign an equal number of incoming leads to each queue. You can also assign cases using a similar formula.

MOD(VALUE(Lead_Number__c) ,3) +1 is the formula for a custom formula field named Round_Robin_ID that assigns each lead a value of 1, 2, or 3. This formula uses a custom auto-number field called Lead Number that assigns each lead a sequential number starting with 1. The MOD function divides the lead number by the number of lead queues available (3 in this example) and returns a remainder of 1, 2, or 3.


  • It will not work on the existing records. In order to make the rule trigger for existing records you should "Mass" update the records.
  • If you are creating a record manually, you can check the "Assign using active assignment rule" under options so that the record follows the assignment rule at the time of creation.

promote demote