How to Conditionally Copy Gravity Forms Field Values to Other Fields

Teach GP Copy Cat to build smarter forms by auto-copying field values only when specific rules are met.

  1. How To Cast a Conditional Spell
    1. Step 1: Identify Your Fields
    2. Step 2: Build Your Condition
    3. Step 3: Apply Copy Cat’s Rule
  2. Putting the Cat to Play
    1. Copy if a field has any value
    2. Copy based on a specific checkbox
    3. Chain Multiple Commands
  3. Next-level Conditional Magic
  4. Your Cat Bouncer is Ready!

Double-entry is a thing of the past thanks to GP Copy Cat’s automatic and checkbox-triggered copying. But its true genius? Knowing when not to copy.

For an event planner, it’s all fun and games until you have to manually manage the after-party guest list. This is where our smart cat comes in, adding guests to that list only if they pass the check.

Come, let’s teach our cat to think before it acts. 🧠

This article requires the Gravity Forms Copy Cat perk.

Buy Gravity Perks to get this perk plus 50 other premium Gravity Forms plugins!

View Plugin Buy Now

How To Cast a Conditional Spell

Let’s build a gamecon registration form and teach our cat a simple rule: automatically add a guest to the after-party list, only if they’re 21 or older. Underage? They don’t get past the velvet rope. (Sorry, kiddos!)

Step 1: Identify Your Fields

First, you’ll need to know the Field IDs for your source, target, and conditional fields. You can find the ID in the top right corner of each field’s settings.

Our key fields:

  • Source: Attendee Name field (ID 1)
  • Condition Field: Radio Button field for “Are you 21 or older?” (ID 3)
  • Target: After-Party Guest Name field (ID 4)
Gravity Forms editor showing an Attendee Name field, radio buttons with Yes/No options, and an After-Party Guest Name field.

Tip

Make finding field IDs for your Copy Cat spells easier with our snippet that Displays Field IDs Next to Field Labels.

Step 2: Build Your Condition

Copy Cat’s magic works through a special formula we add to a field’s settings. If you’re new to them, our guide on manual copying with Copy Cat is the perfect place to start.

This formula goes into the Custom CSS Class on our condition field (Radio Button field). It’s a simple instruction that tells Copy Cat:

  1. What to copy
  2. Where to send it
  3. Which condition(s) must be met

The formula looks like this:

copy-{sourceID}-to-{targetID}-if-{conditionID}

For our gamecon form, that’s: copy-1-to-4-if-3.0

Step 3: Apply Copy Cat’s Rule

The crucial part: make sure to add Copy Cat’s rule to the condition field. This is where it detects changes.

  1. Click on your condition field (Radio Buttons field ID 3).
  2. Go to the Appearance tab.
  3. In Custom CSS Class, enter your Copy Cat rule: copy-1-to-4-if-3.0.
  4. Save your form.
A Radio button field is selected, with the settings open on the right. The 'copy-1-to-4-if-3.0' class is entered in the Custom CSS Class box.

Done! Now, when users select “Yes,” their name copies to the after-party section. Select “No,” and that field stays empty—no party for you!

Animation shows user typing their name, selecting "Yes" to age verification radio field, and their name automatically copying to the After-Party name field.

Putting the Cat to Play

Let’s take it up a notch. Here’s how our smart cat handles more specific situations.

Copy if a field has any value

You can copy a {source} field to {target} field whenever the {condition} field contains anything at all. Like copying guest details to the Dietary Needs list only if they’ve entered something in the dietary needs field. Doesn’t matter what they wrote, just that they wrote something! 

A user typing in 'Vegetarianism' in the Dietary Restriction text field, and their name automatically copying to the guest name field under the VIP list.

Copy based on a specific checkbox

This copies {source} field to {target} field only when the second checkbox in {condition} field is selected.

Maybe you have multiple after-party options, and you only want to copy details when they specifically check the second checkbox (“21+ Bar Access”).

A user checking 'Swag Bag' and '21+ Bar Access' checkboxes. When the second checkbox is selected, their name automatically copies to the 'Bar Access List' field below.

Chain Multiple Commands

Another Copy Cat power play is chaining multiple commands by adding a space between classes. This is our key to copying multiple fields at once (we have a guide that tackles this in detail). Combine this with our conditional spell in Step 2, and we can create some truly smart automations. For example, a single “Yes” click can copy both a guest’s name and email to their respective fields in the after-party section.

A user selects 'Yes' to age verification radio field, and their name and email are automatically copied to the After-Party name and email fields.

Next-level Conditional Magic

We have cool snippets that unlock even smarter cat tricks:

  • Clear Field Values: When your Copy Cat bouncer needs to revoke access, this snippet automatically clears a target field if a user changes their mind. For example, clearing a name from the after-party list if a guest switches their “21+” answer from “Yes” to “No.”
  • Conditional Copy by Trigger Field: This lets you copy different fields based on user selection. For example, auto-fill shipping details from either home or work address depending on what the customer selects.

Your Cat Bouncer is Ready!

A (Copy) cat that thinks before it acts. Smart! What’s the first rule you’re going to build?

Leave a Reply

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

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.


Grab a bundle of free Gravity Forms plugins

Enter your email and receive our most popular free plugins and snippets, plus access to hundreds of others.

This field is for validation purposes and should be left unchanged.