Gravity Wiz

Magically enhanced tutorials, snippets and plugins for Gravity Forms!

  • Gravity Perks
    • Gravity Perks
    • Tutorials & Snippets
    • About
  • Support
    • Documentation
    • Support
    • Account

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).

Last updated December 12, 2020 | Written by Scott Buchmann 4 Comments

  • September 26, 2020: Added support for limiting how many times a given choice is selected by Round Robin via GP Limit Choices.

View DemoView CodeDownload Code

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.

  1. Overview
  2. Using the Snippet
    1. Prerequisites
    2. Add a Drop Down Field
    3. Update Snippet with Form and Field ID
    4. That’s It!
  3. Parameters
  4. Taking It Further

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.

Did this resource help you do something awesome with Gravity Forms? Then you'll absolutely love Gravity Perks; a suite of 32+ essential add-ons for Gravity Forms with support you can count on.

  • View All Perks
  • Buy Gravity Perks

Filed Under: Snippets drop down field snippet

Comments

  1. Kyle Rolfe says

    October 1, 2020 at 5:33 pm

    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

    Reply
    • Scott Buchmann says

      October 1, 2020 at 5:41 pm

      Hi Kyle,

      I reached out directly through our Support queue to dig into this one.

  2. Matthew Wilson says

    April 28, 2020 at 11:56 am

    having trouble installing this. can anyone assist? :)

    Reply
    • Ryan Donovan says

      April 28, 2020 at 12:27 pm

      Hello Matthew, what kind of issue are you having? Please check out our Snippet Troubleshooting section to see if these tips help you out.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Categories

  • How To (64)
  • News (21)
  • Plugins (14)
  • Releases (7)
  • Resource (3)
  • Snippets (58)
  • Tutorials (57)
  • Updates (104)

Recent Posts

  • How to Send a Follow-Up and Pre-Fill Information
  • How to Update Posts with Gravity Forms
  • Gravity Wiz Weekly #104
  • The Complete Guide to Using Gravity Forms With Zapier
  • Gravity Wiz Weekly #103

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 2021 · Powered by WordPress · Gravity Wiz LLC

  • Support
  • Affiliates
  • About
  • Sitemap
  • Gravity Perks
    ▼
    • Gravity Perks
    • Tutorials & Snippets
    • About
  • Support
    ▼
    • Documentation
    • Support
    • Account