Idea: It'd be helpful to be able to re-order logic within conditions on actions

Now that Bubble takes a smarter approach to evaluating conditions on actions (i.e., it now stops evaluating the condition once it gets a “no” – awesome!), it’d be extra helpful to have a way to re-order our logic within the condition.

For example, most of the time we’d want to evaluate values in custom-states before we evaluate values within database queries. And,we typically want to evaluate the pieces of logic that are most likely to fail first.

As an alternative, perhaps Bubble could automatically evaluate the logical components of conditions in a smart order, by prioritizing those that don’t require a database search along with those that more frequently resolve to “no.”

Thoughts?

5 Likes

Hey Scott, Emmanuel’s explanation clarifies

In other words, the condition itself is (probably) evaluated the same way as before the change.

You have a good point worth discussion, if the condition has several components with AND/OR operations.

The evaluation rule of left to right makes those general rules more specific.

Only AND operations: Stop evaluating on the first “no”
Only OR operations: Stop evaluating on the first “yes”
Final OR operation: Last component “yes” don’t need to evaluate the first components

You could build up a list of such optimisations.

It would be helpful to know if Bubble does or doesn’t apply these optimisations, so we can keep expensive components in a less-used portion. Or your suggestion is much better, having Bubble optimise it according to which is cheapest.

6 Likes