Skip to main content
All CollectionsBubble FeaturesQuick Tips
How to Use the Do When Condition Is True Event
How to Use the Do When Condition Is True Event
Updated this week

Transcript

In this Quick Tip, we're going to learn about the "Do when condition is true" event. We create this event by clicking to add an event/new workflow, and then navigating to "General" --> "Do when condition is true". Then, we're presented with two properties to define.

First, we must define the condition that we want to use to control the workflow in the "Only when" space. Whatever condition we write here must evaluate to yes or no.

Once we have our condition, we need to set our "Run this" property to either run this workflow "Just once" as the condition is true or run this "Every time" this condition is true. If we set it to "Just once" it will run once per page load, either immediately if the condition is true when the page loads or later when it becomes true.

In this example, we'll click this button to toggle the visibility of Group A. When we do, our "Do when condition is true" will trigger Just once and show our alert on the page.

Our condition checks to see if the Group isn't visible, so we'll toggle it to be visible again and then toggle it once more to hide. This should trigger our "Do when condition is true", but because it's set to "Just once", it won't show our alert again.

If we set its "Run this" property to "Every time" instead, this workflow will run every time the condition is set to true. Thus, now when we toggle the Group, Every time the Group is invisible the condition will run and the alert message will show.

Try this event out for yourself! We're excited to see what workflows you come up with.

That's it for this Quick Tip! For more, be sure to check out bubble.io/academy.

Did this answer your question?