Show cards only when a condition is met (filters, presets)
Use filters to play a card only in the right situation, and save filters you use often as presets.
Understand filters
A filter is a condition on a card. The card is only played when the condition is true. A common example is to show a button to live chat only when agents are online.
A filter has four parts:
- Type: what the filter looks at.
- Attribute: the value the filter checks. An attribute is a value the bot saves during the chat, sometimes called a variable. Attributes are set by buttons, inputs or components during the conversation.
- Condition: how the value is compared, for example equal to.
- Value: the value that must match for the card to play.
For example: if the attribute mail_success is true, play this card.
Pick the filter type
| Type | The card plays when |
|---|---|
| Entity | an entity is found in what the user wrote |
| Parameter | an attribute is set in the conversation |
| System | a system value matches, for example the number of online agents |
| Confidence level | the bot's confidence reaches a level you set |
| Conversation | the conversation reaches a state you set |
| Chat | the chat reaches a state you set |
Add a filter to a card
⚙️ Set it up:
- Go to Scenarios → Builder and open the scenario.
- Click + Filter on the card.
- Choose the type, the attribute, the condition and the value. Or choose a preset.
- Click Save scenario.
- Click Open widget and test the scenario in a new chat, once when the condition is true and once when it is false.
Save a filter as a preset
A preset is a filter you create once and reuse in many scenarios. It saves clicks and keeps your scenarios consistent.
- Go to Administration → Presets.
- Click Create under Scenario bot response filter.
- Give the preset a name and a description.
- Set up the filter, for example "agents are online".
- Choose who should have access to the preset, and save.
Use the preset in the Builder: click + Filter on a card and choose the preset.
💡 Pro-Tip
Create two presets that belong together, for example "agents online" and "no agents online". Put them on two cards next to each other: one that offers live chat, and one that offers another way to get help. Then the user always gets a way forward.