# Two actions, one button/icon

**URL:** <https://community.weweb.io/t/two-actions-one-button-icon/5034>\
**Category:** How do I?\
**Created:** [October 24, 2023, 12:22pm UTC](https://community.weweb.io/t/two-actions-one-button-icon/5034 "2023-10-24T12:22:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![benji241](https://avatars.discourse-cdn.com/v4/letter/b/bb73d2/32.png) [@benji241](https://community.weweb.io/u/benji241)\
**Post date:** [October 24, 2023, 12:22pm UTC](https://community.weweb.io/t/two-actions-one-button-icon/5034/1 "2023-10-24T12:22:09Z")

</div>

How do you set an interaction into an icon. For example if I use a workflow on clicking an icon to expand a hidden div but then I want to use that same icon to hide the div. I am used to setting another action or workflow into that icon. What is the correct way to do it in Weweb?

---

<div class="post-metadata">

**Author:** ![raydeck](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/raydeck/32/384_2.png) [@raydeck](https://community.weweb.io/u/raydeck)\
**Post date:** [October 24, 2023, 12:47pm UTC](https://community.weweb.io/t/two-actions-one-button-icon/5034/2 "2023-10-24T12:47:09Z")

</div>

You can use an if/then to determine which path you want your workflow to go down based on the value of a variable. You could use a var to store whether the div is hidden/shown, and depending on the current state, decide which actions you want the workflow to take.

Branching is a super-powerful idea in workflow building. Once you get a taste, you’ll find there’s so much more you can create and much faster than you thought possible! Introducing and managing more complicated flows is part of the hardest 5% we work on in [State Change daily office hours](https://statechange.ai).
