View Categories

Using Variables in Conditional Logic

Global Variables lets you use the evaluated result of a variable inside Gravity Forms conditional logic — including field visibility rules, feed conditions, notification conditions, and confirmation conditions. You can base any of these rules on the output of a reusable formula, instead of recreating the same expression in multiple places.

How It Works #

When a variable appears in a conditional logic rule’s value, the plugin expands and evaluates it just before that rule is checked. Gravity Forms then compares the resolved value against the condition you set.

This works for all conditional logic types in Gravity Forms:

  • Field conditional logic — show or hide fields
  • Feed conditions — control which feeds fire (payment, CRM, webhook, etc.)
  • Notification conditions — control when email notifications are sent
  • Confirmation conditions — control which confirmation is displayed

Typical Uses #

  • Show or hide a field when a calculated total crosses a specific threshold
  • Reveal additional options only when certain computed criteria are met
  • Gate follow‑up fields behind dynamic values (for example, only display a field if a calculated discount or score is high enough)
  • Send a notification only when a calculated score or total meets a condition
  • Route a feed based on the output of a formula

Important Notes #

  • Make sure your variable returns a value type that matches what your condition expects (for example, a number if you are doing numeric comparisons).
  • Variables are resolved at rule evaluation time, so they always reflect the current entry data at the moment the condition is checked.
  • Nesting works normally here — if your variable depends on other variables, they are resolved first.
  • If the result doesn’t behave as expected, test the variable on a simple HTML field to confirm what value it produces before wiring it into conditional logic.

Please note this is only available with the Premium or Agency plans.

Example #

A field is shown only if the evaluated value of {grand_total} is greater than 500.

Condition:

Show this field if
{grand_total}  is  >  500

With this setup, any change to the underlying subtotal, tax logic, or nested variables automatically updates the conditional behavior of that field.