Skip to content

Steps

Filter

Send the chat down different paths with if / else conditions on answers and data.

What it does#

Filter checks conditions and picks a path, without sending anything to the customer. It has one or more groups (shown as If 01, If 02, ...) and an Else. Groups are checked from top to bottom: the chat follows the first group whose conditions are true. If none is true, it follows Else.

Examples: send VIP customers to a priority path, route by city, check that an order number exists before showing its status, or offer a discount only above a certain amount.

The Filter step

Build a filter#

  1. 1

    Drag Filter onto the canvas

    It's under Tools in the step list. Connect the step that comes before it.

  2. 2

    Open the first group

    Click the Filter step, then click the If 01 card under Conditions. A panel opens with Condition 1.

  3. 3

    Choose the field

    In Field, pick what to check from the list, for example @city (an earlier answer) or #cphone.

  4. 4

    Choose the operator

    Pick an operator from the list. They're grouped by type: Basic, Text, Number and Date (see below).

  5. 5

    Enter the value

    In Value, type what to compare with, for example Tel Aviv. Typing a plain value turns the switch next to the field on for you.

  6. 6

    Add more conditions (optional)

    Click Add condition, then choose AND or OR between the two conditions.

  7. 7

    Add more groups (optional)

    Click Add group for another path (If 02). Remove a group with the x on its card.

  8. 8

    Connect every output

    On the canvas, connect each If card and Else to the next step.

Operators by type#

TypeOperatorsNotes
Basicexists, does not existNo value needed. True when the field has (or doesn't have) a value.
Textequal to, not equal to, contains, does not contain, starts with, does not start with, ends with, does not end withEach also comes (case insensitive), so Yes equals yes. Without it, case must match.
Numberequal to, not equal to, greater than, greater than or equal to, less than, less than or equal toBoth sides are read as numbers: 18 equals 18.0.
Datethe same six as NumberPick the date format: DD MM YYYY, MM DD YYYY, YYYY MM DD or YYYY DD MM. Separators can be /, - or ..

If a Number or Date condition can't read a value as a number or a date in the chosen format (for example the answer is eighteen), that condition is ignored. Ask with a Number or Date step first so the answer is always valid.

AND, OR and groups#

Inside a group, conditions are combined from left to right: A OR B AND C means (A OR B) AND C. To keep things clear:

  • Use AND inside a group when everything must be true: city equals Tel Aviv AND age greater than or equal to 18.
  • Use separate groups for different cases, each with its own path. Groups act like OR between them, but each one can lead somewhere else.

Example#

A gym routes new leads after asking @goal and @age:

GroupConditionsGoes to
If 01@age Number less than 18Youth programs
If 02@goal Text contains (case insensitive) weight AND @age Number greater than or equal to 18Weight loss plan
ElseGeneral membership

A 30-year-old who answered Lose weight matches If 02 and gets the weight loss plan. A 15-year-old matches If 01 first and never reaches If 02. Everyone else goes to Else.

Compare or Expression#

Each condition can be a Compare (Field, operator, Value, as above) or an Expression: one line that is true or false, for checks the operators can't do.

Expression conditions
#status in ["paid", "sent"] && number(@age) >= 18
isFriday(now()) || isHolidayEve(now())
isOpenNow({"Sunday": "09:00 - 18:00", "Monday": "09:00 - 18:00", "Friday": "09:00 - 13:00"})
matches(@id_number, "^\d{9}$")

Switch the condition to Expression, write it, and use Test expression to try it with sample values. If an expression can't be computed when the chat runs, the condition counts as false, you get an alert, and the chat continues. See Expressions for everything you can write.

Common mistakes#

  • Groups in the wrong order. The first true group wins. Put the most specific group first: check VIP and Tel Aviv before Tel Aviv.
  • Comparing numbers as text. With a Text operator, 5.0 doesn't equal 5, and there's no greater than. Use a Number operator.
  • Case-sensitive text. Tel aviv doesn't equal Tel Aviv. Use the (case insensitive) version.
  • The field isn't in the list. Turn on the switch next to Field and type it, for example {{#customer.tier}}.
  • Else isn't connected. Customers who match nothing get stuck. Always connect Else.