# 2 State Toggle Button

**URL:** <https://forum.inductiveautomation.com/t/2-state-toggle-button/4477>\
**Category:** Ignition\
**Created:** [May 15, 2012, 5:37pm UTC](https://forum.inductiveautomation.com/t/2-state-toggle-button/4477 "2012-05-15T17:37:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![moralesm](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@moralesm](https://forum.inductiveautomation.com/u/moralesm)\
**Post date:** [May 15, 2012, 5:37pm UTC](https://forum.inductiveautomation.com/t/2-state-toggle-button/4477/1 "2012-05-15T17:37:03Z")

</div>

What is the prefered method to tie 2 or more boolean tags that must all be true in order for the 2 State Toggle Button to be true

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [May 15, 2012, 5:53pm UTC](https://forum.inductiveautomation.com/t/2-state-toggle-button/4477/2 "2012-05-15T17:53:53Z")

</div>

In that case, don’t bind the “Control Value” property and bind the “Indicator Value” property to an expression like this:`{Path/To/Boolean1} && {Path/To/Boolean2} && {Path/To/Boolean3}`So the expression will return 1 when all are true and 0 otherwise.

If you want to write to tags when the button is pressed you either:

1. Bind the “Control Value” property to a single tag if you only need to write to one tag or
2. For multiple tags you can put an event of the actionPerformed:`value = not event.source.controlValue
system.tag.writeToTag("Path/To/Boolean1", value)
system.tag.writeToTag("Path/To/Boolean2", value)
system.tag.writeToTag("Path/To/Boolean3", value)`
