Gravity Forms Round Robin
Distribute leads evenly to a group of sales reps, schedule employees for the next available shift, or balance the responsibility of any task-oriented submission (e.g. support requests, job applications, contest entries).
March 7th, 2024: Added support for excluding GP-Inventory-enabled choices with exhausted inventory.
January 10, 2022: Added support for rotating through choices dynamically populated by GP Populate Anything.
September 26, 2020: Added support for limiting how many times a given choice is selected by Round Robin via GP Limit Choices.
Overview
Imagine you have a form where you’d like to automatically cycle through the choices of a designated field with every entry. The cycle starts with the first choice, progressing to the next available choice on each submission. After each choice has been assigned, it will restart from the first option.
The practicality of this is for any task-oriented form, such as sales leads, support requests, or a shift scheduler. Whatever choices are stored in the choice-based field will be cycled for each submission, evenly distributing the values across all submissions in a first-in-first-out basis.
Using the Snippet
Prerequisites
Confirm that you have Gravity Forms installed and activated and that you’ve installed the snippet.
Add a Drop Down Field
With the snippet installed, add a Drop Down Field to your form and set the choices to the different values you want to cycle through. This field will automatically be hidden by default.
Check out Populate Anything for an easy way to dynamically populate the choices in the Drop Down.
Update Snippet with Form and Field ID
Update the form_id
and field_id
in the snippet to match your Form ID and the Field ID for your Drop Down from above.
new GW_Round_Robin( array(
'form_id' => 123,
'field_id' => 4
) );
That’s It!
When the form is submitted, the snippet will cycle to the next value in the Drop Down for every submission.
Parameters
form_id (integer) (required)
This is the Form ID where you want to cycle through the choices. There is no default value.
field_id (integer) (required)
This is the Field ID for the field where the choices are stored. There is no default value.
hide_field (boolean) (optional)
Automatically hide the choice-based field. The default value is
true
.
Taking It Further
This snippet should be considered a building block to create round robin forms. For an example of how this can be implemented in a real world scenario, check out the How To Evenly Distribute Leads to a Sales Team with Gravity Forms tutorial.
Hey there,
I got the following error message:
Creation of dynamic property GW_Round_Robin::$_args is deprecated
Check GitHub and haven’t seen update on the snippet.
Hi Marco,
Thanks for bringing this to our attention. I’ll forward this to our developers to look into it. We’ll update this comment when it’s fixed.
Best,
Hi Marco,
We have updated the snippet and it fixes “deprecated” notices / PHP warnings. Please find the updated version here: https://gravitywiz.com/snippet-library/gw-round-robin/
Hope this helps.
Best,
Hi all! Looking for a software that allows a particular project (a writer sends a .pdf doc) to be submitted to a pool of workers (say proofreaders) and based on their availability they could pick up the document, proofread it, and then send for verification. And there would also be a pool from which verifiers, if available, could choose to pick up the document to verify and then send for final approval (to 2 people who each have to approve). Then if they reject it for any reason the document would leave to go to the original writer and then go back to the original proofreader (not into the pool), then verify pool, then approver(s). Hopefully that makes sense! I’m struggling to know what software would allow a document to be based around as fast as possible – while ideally keeping the most “up to date version” accessible with prior versions in archives. Is this something your tools can provide?
Hi J,
We don’t have a ready solution for this, but Gravity Flow sounds like a perfect fit here.
I get this error : Uncaught Error: __clone method called on non-object in /var/www/vhosts/clients.belva.co.ke/httpdocs/mivida/wp-content/plugins/GF-AutoAssign/gf-autoassign.php on line 146
Hi Godwill,
That error message doesn’t appear to be related to the Round Robin snippet. It looks like an issue with the GF AutoAssign plugin on your website. I’ll suggest you get in touch with the developer of that plugin.
Best,
Hello, Is it possible to have each form submission sent to multiple recipients from the Round Robin Emails field? I would like an option to change the number of recipients to 3 (or any value I enter) … something like:
new GW_Round_Robin( array( ‘form_id’ => 123, ‘field_id’ => 4, ‘form_recipients’ => 3 // number of recipients per form submission ) );
Taking it further, would it be possible to have each recipient have (2) notifcation methods such as their email address and their mobile phone number as well (which are actually email addresses themselves)?
In my ideal scenario, I would use the populate anything module to provide entries for the round robin module, and to “load” recipients based on the user role “advertiser” and to populate each of their entries with (2) values from their profile (the email address, and phone number).
Thanks, and I hope this made sense!?
Chris
Hi Chris,
The snippet as it is, wouldn’t be able to do what you want and will require some customization to get it working for you. If you have an Advanced or Pro Gravity Perks License, you can get in touch with us via our support form so we can take your request and forward it to our developers to see if this can be supported.
Best,
Great snippet. Lets say I have a website and I only want currently logged-in users to be selected. How would I do this or is it even possible to filter the dynamically populated list of users this way?
Hi Newbie,
I don’t think this is possible without some custom code because WordPress doesn’t have a built-in function to identify all currently logged-in users. You may need to custom code this functionality because you won’t be able to use GP Populate Anything as it is, to get a list of all currently logged-in users.
Best,
Thanks this seems very helpful for lead distribution. Would you be able to go about getting duplicate leads to go to the same person? For example, someone has sent in a form entry and they forgot something so they submit another with more information.
Thanks!
Hi Chris,
If the data of the user that sends the form is saved in the Entry, my guess is that you could use GP Populate Anything to match the previous data with the current data similar to this other tutorial How To Evenly Distribute Leads to a Sales Team with Gravity Forms.
If you have an active Gravity Perks License, you can get in touch with us via our support form with your account email address and we’ll be happy to dig into this further.
Best,
I’m having trouble getting this to work as well. It’s not automatically hiding the field and it doesn’t seem like it’s actually selecting any of the options either. I’m trying to sequentially assign 1 of 3 products on each submission, so I’m pretty sure this snippet is exactly what I’m looking for, but I can’t seem to figure it out.
Here is the full functions.php file: https://snippi.com/s/as2mdcz
Hi Kyle,
I reached out directly through our Support queue to dig into this one.
having trouble installing this. can anyone assist? :)
Hello Matthew, what kind of issue are you having? Please check out our Snippet Troubleshooting section to see if these tips help you out.