Is there a way to set conditions

Is there a way to set conditions? For example: changing a text or the visibility of an element based on a data condition.

1 Like

Hey @josefernandez, this is definitely something that is on the table in the future for the app builder. There are currently 2 issues in Gitlab related to this:

Add complex conditions to element visibility tab (#2472) Ā· Issues Ā· Baserow / baserow Ā· GitLab and Add support for advanced formulas (#3164) Ā· Issues Ā· Baserow / baserow Ā· GitLab

1 Like

Hi, any news on this? Thanks

Hi @josefernandez and @Luciano, I’m happy to report that this feature became available in the 2.0 release. If you open an element’s ā€œVisibilityā€ tab, there is a new formula field in there called ā€œVisibility conditionā€. If this evaluates to true, then your element will be visible.

Cheers,

Peter Evans

Thanks a lot! Would you please link documentation or explain the exact syntax? I’m having issue using Visibility conditionā€, it don’t work as I tested

Hi @Luciano, please accept my apologies, you found a little bug which is being resolved at the moment.

The element visibility is working correctly, but if you use form data in your formula, it won’t. You can try other formula values in the meantime, so long as the result is ā€œtrueā€ then the element will be visible.

Cheers,

Peter Evans

1 Like

Thanks a lot Peter!

Unfortunately I’m still having problems understanding, for instance, how to show a component IF a field from Data source CONTAINS a specific value.

Same problem if, le’ts say, I need to show a component only if a a field from Data source HAS ANY VALUE. Or using a regex.

I can’t find theese operators in the choices:

Do you have some documentation I can refer to formula and operators for this kind of scenario?

My pleasure!

The ā€œadvanced modeā€ (with the operators and functions) is very new; it was introduced in Baserow 2.0 recently. As a consequence of this, we’re still adding new functions and operators, so there could be some gaps in the functionality.

For now, what I suggest is using the get/list rows data sources, in combination with filters, to reduce your data down to ā€œhas any valueā€.

Once this is done, if you swap to your element’s visibility, and apply this formula, it will hide/show the element if your filters returned rows:

Once we have a length function, which should arrive very soon, it will be a little easier to implement.

I hope this helps!

Cheers,

Peter Evans

1 Like

Thanks for your answer.
Can I ask if there is any documentation arround because I’m trying to use the ā€œorā€ function without success so far.
The visibility page seems out to date.
This is working : get(ā€˜form_data.4813’)=ā€œouiā€
This is working : get(ā€˜form_data.4813’)=ā€œnonā€
But this is not : get(ā€˜form_data.4813’)=ā€œouiā€||get(ā€˜form_data.4813’)=ā€œnonā€
Thanks !