How to setup Round Robin assignment for any object in Salesforce

Posted on: May 21, 2023
Yes, you read right, this method works for any object and not just leads in Salesforce. This article explains a “simple” and easy flow to help you assign anything in a round robin style in Salesforce. Most people only use this for cases and if that's you, then sure go ahead and knock yourself out!
For illustration purposes, I will be using this method as if I am designing it for cases. However, as already mentioned, this works for any object.
Round Robin assignment flow in Salesforce

Background

TL;DR: If you don't want to read through why I came up with this method and why it's significantly better then skip right ahead to the Setup.

The current solution

A simple google search as of June 5 2022, returns results that mostly use assignment rules and the formula:
MOD(VALUE({!i<incremental field name>}),<number of users in queue>)+1.
This method does get the job done however, it has its flaws:
  1. You have to constantly change the formula.
    The formula works based on the number of users you would have set in the formula field. If you add someone to your team or to the queue, you have to go to each instance where the formula is used and update it. That’s a lot of work.
  2. There is no reporting!
    One of the key metrics managers love to see is how many cases someone has handled in line with their queue. For example, if Tom is assigned a Tier 2 support ticket, he can handle it and after resolution, pass it back to customer service Tier 1 team to communicate the resolution to the client. While Tom would have been assigned the ticket using the correct algorithm, Toms' manager is unable to know in a report that Tom handled a Tier 2 support ticket?
  3. Additional fields 😒
    Personally, I am big on efficiency! Most successful organizations adopt a lean business model too. What this means is, one works to improve the process and eliminate waste for optimum output! Creating 2 fields that do not provide any reporting and key metrics really is waste.
And so this brings us to our proposed solution

The Logic

I have simplified the explanation in this article for the sake of time and as well, to ensure this is not just a long read. For a more detailed explanation, I can create a video explaining How to create round robin case assignments in Salesforce. Let me know if this is something you'd like.
If you’re a Salesforce Admin and have as much knowledge as I do then you can save yourself from reading this article and implement something of your own. However, you may just want to read some of the steps below as they may help you troubleshoot or improve your own process.
Answer: In order to assign a record to each individual in sequence, you need to track who was assigned the last record in a queue and assign it to the next person in the same queue.
You create the queue(s) and design a flow that gets all members belonging to the queue, checks for the user who was last assigned a case and moves in the list to the next available user and assigns them the case.
That’s it, it’s that simple! The execution however, is not as simple.

The Setup

  • Create queues that you would like the assignment to be carried out on. For example, you can call these L1 support and L2 support (for Tier 1 and Tier 2 support queues).
  • Don’t forget to assign members to them.
    Have I already lost you in setting up queues? Or maybe, you just need a quicker way out? Reach out to us and we can set up your assignments for you.

    The Execution

    Now that that's done, comes the heavy work-the flow!
    1. Trigger
      You may want new cases to automatically move to Level 1 support while escalated tickets are divided up amongst Level 2 members. This means you would have a flow that runs on creation or update. If created, it would be assigned to L1 reps, if updated, it goes to L2.
    2. Iterable
      • You get the queue that’s been chosen based on your trigger.
      • Get the last assigned case owner from all cases
      • Sort your queues by a determinant of your choice. I’ve chosen the name.
      • Run through the sorted members checking if each one is equal to the last assigned user. Once you find the last assigned user, you activate your trigger which will assign the user on the next run.
    3. Finale
      After the last run through, you set the owner ID of the case. Viola!

    Benefits of using a Flow

    1. It’s easy to add people to the assignment group.
      If someone new joins the company and now also works in the Level 1 Support queue, they only need to be added to the queue under Setup > Users > Queues and that will automatically start them catching up to everyone else who is in the queue.
    2. You can get some stats on how many cases someone has managed.
      Each time a user is assigned a case, you can set a field to be incremented. This is really useful!
    3. Lean development
      There are no additional/unnecessary fields created.
    4. Reusability
      If a case, is updated into different queues based on different status, you can pass the Id and queue name/Id to a subflow which can run and execute outside of the initial flow and that way, you have code modularity.

    Clarification

    Round robin assignment means you would assign 1 case to each person and repeat, it does not make reference to whether the cases are equally divided or not.
    In addition, this method does not set new team members go first on the next assignment. A new addition will have to wait until their turn comes up based on the order you would have selected

    Need help?

    It takes quite a bit of work to make sure everything is set up correctly. At Adnab, we are trained and certified to set up round robin case assignment and more! We're more than happy to help so you can get the most out of Salesforce!
    Start the conversation by filling out this form.