Conditions are one of Embeddable’s powerful logic features, and have a variety of use-cases.

A Condition decides whether a page or component is shown or hidden, based on the value of a property in User Data.

To set up a Condition, you define which values are acceptable for a User Data property. If the property has those values, then the page or component is shown - if not, then it is hidden.

Showing/Hiding a component or page with Conditions

1

Go to the Page/Component Options

  • Select the page or component, in the Layers sidebar or (in the case of a component) in the central preview pane.
  • Make sure you’re on the Content tab at the top-left.
  • Click on Options in the tabs at the top of the right-hand sidebar.
2

Add a Condition

  • Click the + Add condition button.
  • Choose the key in User Data that you want to impact whether this page/component is shown or hidden.
  • Choose the type of operator for the Condition - usually this is Is or includes.
  • Choose the value that should make this page/component be shown.

The way to think about key, operators and values in a Condition is like an equation.

For example, you might want to display a some warning text to users under 18, so the condition is effectively age_range = 'under_18'.

Here, age_range is the key, Is or includes is the operator, and under_18 is the value.

Available Condition Operators

Below is a detailed explanation of each operator type you can use in Conditions, and exactly how they work:

When working with arrays in conditions, remember that the behavior can be different from single values. For example, the “Is or includes” operator will match if ANY of the specified values are found in the array, while “Is not or excludes” will only match if NONE of the specified values are found.

Special values like _true, _false, and _no_value are automatically converted to their appropriate types when used in conditions. For example, _true becomes the boolean value true when evaluated.