> ## Documentation Index
> Fetch the complete documentation index at: https://docs.invoca.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Dashboard Schedule Gating Conditions in Practice

> A worked example of using a gating condition to only email a scheduled Dashboard when specific business rules aren't met.

When you [schedule a Dashboard job](/s/article/schedule-a-dashboard-job), you can add a gating condition that determines whether Invoca sends the scheduled email. If the condition evaluates to `true` at the scheduled time, Invoca emails the Dashboard to the specified recipients; if it evaluates to `false`, Invoca doesn't send it.

This article walks through an example scenario that uses a gating condition to alert specified users only when there's a problem worth flagging.

## Gating condition functionality

A gating condition is a statement that returns a single boolean value (`true` or `false`). For example, `sum (revenue) > 100` is a valid condition, but `is_weekend (commit_date)` is not, since it returns a result per row of data. Invoca checks the formula syntax, but doesn't validate whether the formula returns a valid single boolean.

For a list of valid formulas, see [Formula function reference](/s/article/formula-function-reference).

## Gating condition example

You can use gating conditions to send alerts. For example, suppose you notice invalid data appearing in recent data loads, even though the loads seem to succeed. You can validate incoming data by setting business rules, such as:

* **Sales validation:** the sum of sales today versus yesterday shouldn't vary by more than 20%.
* **Product validation:** the unique product count should be greater than 4,000 but less than 5,500.
* **Customer validation:** the unique customer count should be greater than 20,000.

Create a view with these business rules, then create a Dashboard schedule with a gating condition that references them. The schedule then notifies specified recipients if any rule isn't met, suggesting a problem with the data.

### Create a view

After determining your business rules, create a view that includes them. This simplifies the gating condition formula and ensures it returns a single result, rather than multiple rows of data.

### Create a Dashboard to schedule

Create the Dashboard Invoca sends at the scheduled time if the gating condition is met — optionally including Dashboard Tiles that show which exceptions failed.

### Create the Dashboard schedule

After creating your view and Dashboard, follow [Schedule a Dashboard job](/s/article/schedule-a-dashboard-job) to create the Dashboard schedule.

### Define the gating condition

Because the view already defines the three exceptions, the formula is simple:

```text theme={null}
if (sales exception or product exception or customer exception) then true else false
```

This formula returns a single boolean value — the gating condition **must** return one, and must not return a result per row of data.

Save the gating condition and select **Schedule**. At the specified time and day, Invoca checks whether any of the three business exceptions are met, and if so, sends the alert to the specified recipients, who can fix the issue.

## Where to go next

* [Schedule a Dashboard job](/s/article/schedule-a-dashboard-job)
* [Formula function reference](/s/article/formula-function-reference)
