Table of Contents

Formulas - Logical

Judit Updated by Judit

If this is your first time using Formulas, please check our Getting Started guide here and our crash course here

This is a logical function used to require more than one condition at the same time. If the compared expressions are not the same type, Landbot will attempt to convert them to the same type before the comparison.

Formulas available

  • And
  • If
  • Not
  • Or

AND

Example: If email contains "gmail.com" AND the age is over 18 the formula will have to look like the following:

And(Contains(@email,"gmail.com"),IsGreater(@age,18))

IF (ternary)

With this method, you will be able to assign one value based on a true/false condition. If it is true, you will assign a value and if it is false you will assign another value.

Check if the age is above 18, and assign a text value to a variable called @check

In the formula below, you can see "if age value is greater than 18", we will assign the value "Is greater" to the variable "@check". Otherwise, we will assign the value "Is not greater" in the variable "@check".

If(IsGreater(@age,18),"Is greater","Is not greater")

Not

Not 0

This formula is used to negate an expression and works with Boolean data type.

Details
Boolean Data type: Data type that has one of two possible values; True/False, 0/1.
Not(0)

OR

Barcelona OR Madrid
Or(IsEqual(@city, "Barcelona"),IsEqual(@city,"Madrid"))

How did we do?

Formulas - String

Formulas - Math

Contact