IF Statements to filter database results

Can IF statements be used based on database values?

Hi Paul,

Yes, IF statements can be used. So when you create an action, click advanced options and then you will see ā€˜when should this action run’, ā€˜sometimes or always’. This is Adalo’s version of the IF statement.

If you select ā€˜sometimes’, this then gives you options to specify when the action is run.

Hope this helps.

Craig

Thank you Craig, I’ve tested this but it does not seem that there is an option to check current records. For instance, I would like to use a form to create a city name, the city name should be created only when the city name is not yet in the database.

Hi @plandman,

For this I’d recommend creating a custom form, i.e. add an input field ā€œCity Nameā€ and ā€œAddā€ button. For this button, you could make an action to be conditional (like @crmorris2 has advised above).
And then you add a city if Count of Cities where name equals input field’s value, equals to zero.

There is a tutorial I’ve made some time ago on a similar topic:

Best,
Victor.

2 Likes