# Can I set the state of many elements with one action?

**URL:** <https://forum.bubble.io/t/can-i-set-the-state-of-many-elements-with-one-action/12968>\
**Category:** Need help\
**Created:** [April 29, 2017, 12:42am UTC](https://forum.bubble.io/t/can-i-set-the-state-of-many-elements-with-one-action/12968 "2017-04-29T00:42:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gooseandbear01](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gooseandbear01](https://forum.bubble.io/u/gooseandbear01)\
**Post date:** [April 29, 2017, 12:42am UTC](https://forum.bubble.io/t/can-i-set-the-state-of-many-elements-with-one-action/12968/1 "2017-04-29T00:42:22Z")

</div>

Hi there!

I’m trying to set the state of many elements with just one action rather than setting each elements state individually with separate actions. Can someone please advise?

For context, what I’m trying to achieve is as follows:  
When a user clicks on an icon it sets the colour of that icon to green and sets the colour of all other icons to grey.

Cheers

---

<div class="post-metadata">

**Author:** ![romanmg](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/romanmg/32/237672_2.png) [@romanmg](https://forum.bubble.io/u/romanmg)\
**Post date:** [April 29, 2017, 1:35am UTC](https://forum.bubble.io/t/can-i-set-the-state-of-many-elements-with-one-action/12968/2 "2017-04-29T01:35:12Z")

</div>

Your icon click could set 1 state to a value (ex: “ABC”) and then all the other icons could have a color **condition** on them to change to grey when the value is ABC. That way you don’t need to mess with a bunch of separate states. Multiple elements just react to a single state.

---

<div class="post-metadata">

**Author:** ![gooseandbear01](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gooseandbear01](https://forum.bubble.io/u/gooseandbear01)\
**Post date:** [April 29, 2017, 2:34am UTC](https://forum.bubble.io/t/can-i-set-the-state-of-many-elements-with-one-action/12968/3 "2017-04-29T02:34:07Z")

</div>

Thanks @romanmg! That’s working like a charm 😄 you’ve saved me a lot of time.

---

<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:** [July 8, 2017, 12:53am UTC](https://forum.bubble.io/t/can-i-set-the-state-of-many-elements-with-one-action/12968/4 "2017-07-08T00:53:14Z")

</div>

Closed on July 8, 2017, 12:53am UTC

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