Conditional Actions
Last updated
Last updated
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 available for delivery. 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.
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.
Select your component.
Set up your action.
Select the action.
Select Show Advanced.
Under When does this happen? Select the drop down arrow where it says Always and change it to Sometimes.
There are three parts to setting up a condition: the property that the condition will apply to, the comparison type and the comparison value.
When using a Link Action with multiple conditional Actions, one of those links must be a non-conditional action to act as a 'fallback' option.
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.
The comparison type is set up as a drop-down. Depending on what property you have selected, the comparison type options may vary.
For Texts the available options are:
Is equal to, Is not equal to, Contains
For Numbers the available options are:
Is equal to, Is not equal to, Is greater than, Is less than, Is greater than or equal, Is less than or equal and Is between
For Toggles the available options are:
True, False
For Date & Time the available options are:
Is after, Is before, Is between
For Images the available options are:
Is equal to, Is not equal to
For Files the available options are:
Is equal to, Is not equal to
For Addresses the available options are:
Is within, Is not within- Miles of, Kilometers of
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.
Underneath where it says This Action will only happen if... select the drop-down arrow next to where it says Select.
Select the property.
Select the comparison value
Set the comparison value
Select Done.