# Conditions

Payload conditions allow you to control when a [reactor](/product/loyalty-engine/reactors/get-started-with-reactors.md) is triggered, based on specific data within the event’s payload. This gives you more flexibility to create highly targeted responses, ensuring that reactors only fire when specific criteria are met.

By using payload conditions, you can fine-tune your loyalty program to reflect the exact behaviours and actions you want to reward or react to.

Conditions can be based on:

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Event data</strong></td><td>Conditions relating to data of the particular event being reported.</td><td><a href="/files/gqmpqTrMO0pmPi0Zw7Ow">/files/gqmpqTrMO0pmPi0Zw7Ow</a></td><td><a href="/pages/tSVRCcu5Ty7slQWR4RRS#event-specific-conditions">/pages/tSVRCcu5Ty7slQWR4RRS#event-specific-conditions</a></td></tr><tr><td><strong>Audience data</strong></td><td>Conditions relating to the audience(s) the user reporting the event has joined, left or is a member of.</td><td><a href="/files/d9zJhfXCZUqWxisarbTH">/files/d9zJhfXCZUqWxisarbTH</a></td><td><a href="/pages/tSVRCcu5Ty7slQWR4RRS#audience-conditions">/pages/tSVRCcu5Ty7slQWR4RRS#audience-conditions</a></td></tr><tr><td><strong>Points data</strong></td><td>Conditions relating to the points balance or earning history of the user reporting the event.</td><td><a href="/files/OnASAxvddSA8Y9mnvXoV">/files/OnASAxvddSA8Y9mnvXoV</a></td><td><a href="/pages/tSVRCcu5Ty7slQWR4RRS#points-conditions">/pages/tSVRCcu5Ty7slQWR4RRS#points-conditions</a></td></tr></tbody></table>

<figure><img src="/files/9KFYrusqG2LzlKZl1Xhy" alt="" width="375"><figcaption><p>Specifying conditions using block mode, and switching to JSON</p></figcaption></figure>

***

## Specifying conditions

By default, the Loyalty Console offers a graphical interface (GUI), known as ‘block mode’, to add conditions based on the selected trigger event.

For more complex conditions, or those involving properties not defined in the [event type’s schema](/product/loyalty-engine/events/event-types/creating-event-types.md#event-type-schema), you can switch to JSON input to configure them manually. Payload conditions must be specified using JSON schema draft 6.&#x20;

{% hint style="warning" %}
Once you’ve entered custom JSON in a reactor's configuration, you cannot return to block mode.
{% endhint %}

***

## Event-specific conditions

Event-specific conditions allow you to tailor reactor behaviour based on details specific to the trigger event. These conditions use data directly from the event payload, providing more control over when reactors are triggered.

Here are some examples of conditions you may expect to find with some common events.

* **Transaction events** may include conditions like total number of line items purchased, specific SKUs purchased, total amount spent, retail location (i.e. store #372), retail channel (i.e. online, in-store).
* **Survey/quiz events** may include conditions like which questions were answered, percentage of survey completed, if the survey was abandoned or completed, ratings given, score.
* **Promo code submission events** may include conditions like the code that was submitted.
* **New subscription events** may include conditions like the selected plan, subscription term, whether it’s a new subscription or a renewal.

To use any of these data points as a condition, they must be included in the event payload and defined in the [Creating event types](/product/loyalty-engine/events/event-types/creating-event-types.md#event-type-schema).

{% hint style="info" %}
**Remember, event types and their associated conditions are entirely defined by you.** It’s up to you to decide which customer behaviours you want to reward, determine the source of your event data, create custom event types with the appropriate payload schemas, and send these events to the Loyalty Engine via API.

For more information, see [Get started with Events](/product/loyalty-engine/events/get-started-with-events.md).
{% endhint %}

<details>

<summary>Event-specific conditions use case examples</summary>

* Only run a reactor when a transaction exceeds £100
* Award bonus points when a purchase includes specific product SKUs
* Trigger a reward only when a user signs up for an annual subscription plan
* Filter out generic events to ensure actions only happen when specific event data is present

</details>

***

## Audience conditions

Audience conditions relate to information about the audiences the user associated with an event is in. There are two types of audience-related condition available: **user in audience** and **specific audience joined / left**.

### User in audience

The *user in audience* condition allows you to choose one or more audiences the user must be a member of for the reactor to activate.

This condition is available for any event type when you enable the [Audiences event enhancer](/product/loyalty-engine/events/event-types/event-enhancers.md#audience-enhancer) in the event type’s configuration.

It’s essential for running targeted campaigns where you want reactors to apply only to specific segments of users based on available [Audience query builder](/product/loyalty-engine/audiences/audience-criteria/audience-query-builder.md).

See [Limit a reactor an audience](/product/loyalty-engine/reactors/reactor-tutorials/limit-a-reactor-an-audience.md) for more information.

{% hint style="info" %}
When using the Audiences event enhancer, the event being reported is enriched with the audiences that user was is in *before* the event occurred. It does not take into account any audience changes which may occur as a result of that event being reported.
{% endhint %}

<figure><img src="/files/xN6JpjtBOxDzvPGjWpUs" alt="" width="375"><figcaption><p>Adding 'User in audience' payload condition</p></figcaption></figure>

### Specific audience joined / left

The specific audience joined / left condition is exclusive to reactors where the trigger is one of the [Audience Joined / Left event types](/product/loyalty-engine/audiences/audience-joined-and-left-events.md). It lets you specify the audience the user must have joined or left for the reactor to activate.

This is used when you want the reactor to trigger when a user [changes their audience membership](/product/loyalty-engine/reactors/reactor-tutorials/create-advanced-or-multi-event-reactors-using-audiences.md).

{% hint style="info" %}
The key difference between these two conditions is that *user in audience* checks for audience membership at the time the reactor is triggered, while *specific audience joined / left* is based on a user’s action of joining or leaving a particular audience.

One is for general targeting, and the other is for audience membership changes.
{% endhint %}

<details>

<summary>Audience condition use case examples</summary>

#### User in audience

Use when you want the reactor to apply only to users currently in a specific audience:

* Award VIP members a bonus when they make a purchase
* Run promotions for users in a certain region (e.g. double points for UK-based users during holidays)

#### Specific audience joined / left

Use when you want the reactor to respond to users entering or exiting an audience:

* Reward users when they join a “High Spenders” audience after hitting 1,000 points
* Re-engage users who leave the “Frequent Buyers” audience by triggering a win-back offer

</details>

***

## Points conditions

Points conditions let you control reactor behaviour based on a user’s points balance or earning history. You can target users based on current balance, points earned in a given time period, or data from the [points event enhancer](/product/loyalty-engine/events/event-types/event-enhancers.md#points-enhancer).

#### Example use cases

* Only run a reactor when a user makes a purchase *and* has over 5,000 points
* Only run a reactor when a user makes a purchase *and* has earned less than 1000 points in the current calendar month


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kbase.whitelabel-loyalty.com/product/loyalty-engine/reactors/conditions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
