Conditional Actions

With Adalo, you can add logic to your actions so that they only happen when certain rules apply. This works very similarly to setting up a components visibility. One example of this is linking to different pages depending on if the delivery zip code that a customer entered is a zip code that you deliver to. Another example is if you were to set up a toggle to allow users to follow and unfollow other users. This example can be found in the How To Allow Users to Follow Others tutorial.

Set up the action to only occur sometimes

To set up the conditions for an action, you will first need to set up the action. For more details on setting up different kinds of actions, you can refer to the help manual for the specific kind of action.

  1. Select your component.

  2. Set up your action.

  3. Select the action.

  4. Select Show Advanced.

  5. Under When does this happen? Select the drop down arrow where it says Always and change it to Sometimes.

Set up the conditions

There are three parts to setting up a condition: the property that the condition will apply to, the comparison type and the comparison value.

Select the property

When selecting what the condition will apply to, you can choose between any current data, form inputs on the current screen, the Date / Time, all of a collection or the count of a collection.

Select the comparison type

The comparison type is set up as a drop down. Depending on what property you have selected, the comparison type options may vary. The most common options are: Contains, Does not contain, Equal to, and Is not equal to.

Set the comparison value

The comparison value is the value that you want the property to contain, not contain, be equal to or not be equal to depending on the comparison that you selected.

  1. Underneath where it says This Action will only happen if... select the drop down arrow next to where it says Select.

  2. Select the property.

  3. Select the comparison value

  4. Set the comparison value

  5. Select Done.