# How to set states "asynchronous" issue?

**URL:** <https://forum.bubble.io/t/how-to-set-states-asynchronous-issue/226916>\
**Category:** Need help\
**Created:** [October 4, 2022, 10:59am UTC](https://forum.bubble.io/t/how-to-set-states-asynchronous-issue/226916 "2022-10-04T10:59:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hermes](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hermes](https://forum.bubble.io/u/hermes)\
**Post date:** [October 4, 2022, 10:59am UTC](https://forum.bubble.io/t/how-to-set-states-asynchronous-issue/226916/1 "2022-10-04T10:59:54Z")

</div>

Hi,

How to change the state only if the state isn’t set ?

Trigger : Click on a button  
Workflow: Set a state to “clicked” (only when state is not-clicked)  
Workflow: Set a state to “not-clicked” (only when state is clicked)

This reset the state to “not-clicked” so how to do ?

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [October 4, 2022, 11:12am UTC](https://forum.bubble.io/t/how-to-set-states-asynchronous-issue/226916/2 "2022-10-04T11:12:02Z")

</div>

Hi there, @hermes… one way to do what you described is to set up two workflow events for the button, and put conditions on the events that specify when each event should run. In your case, one of the events would be something like when the button is clicked and the custom state’s value is “clicked”, and the other event would be when the button is clicked and the custom state’s value is “not-clicked”.

Another way you could go is to have a custom state with a state type of yes/no, and then you could use one workflow event with the handy trick that @adamhholmes describes in [this thread.](http://forum.bubble.io/t/conditional-statements-on-the-changing-fields/224813)

Hope this helps.

Best…  
Mike

---

<div class="post-metadata">

**Author:** ![hermes](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hermes](https://forum.bubble.io/u/hermes)\
**Post date:** [October 4, 2022, 12:31pm UTC](https://forum.bubble.io/t/how-to-set-states-asynchronous-issue/226916/3 "2022-10-04T12:31:42Z")

</div>

Hey @mikeloc, that’s perfect.

TIL: It’s possible to have 2 workflow events for the same trigger !

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [December 13, 2022, 11:00am UTC](https://forum.bubble.io/t/how-to-set-states-asynchronous-issue/226916/4 "2022-12-13T11:00:41Z")

</div>

Closed on December 13, 2022, 11:00am UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
