---
title: Using Variables in Conditional Logic
description: "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…"
url: "https://brightleafdigital.io/docs/using-variables-in-conditional-logic/"
updated: "2026-10-27"
category: Global Variables
---

# 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

- Missing, trashed, disabled, circular, or failed variables make the affected rule false, including `is not` and numeric comparisons. A literal unresolved slug is never compared.
- Numeric comparisons and nested calculations use raw values. Site-formatted thousands separators are normalized only when the value is a valid number for the site's locale.
- Entry context is available in notification, feed, confirmation, and saved-entry workflow conditions. Server-side field conditions can use submitted values. Before submission, entry-dependent variables have no entry and fail closed; they do not recompute in the browser as a visitor types. Use static variables for browser visibility conditions.
- Missing required entry values stop shortcode evaluation. A scoped ledger calculation is not run with an entry-dependent filter whose value is absent.
- 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
```

For browser field visibility, use a variable that can resolve without entry data. Entry-dependent formulas are evaluated on the server when submission data is available.

GravityOps Weekly

[This iframe contains the logic required to handle Ajax powered Gravity Forms.](about:blank)
