# Write a boolean property with a click action in a button

**URL:** <https://forum.inductiveautomation.com/t/write-a-boolean-property-with-a-click-action-in-a-button/32002>\
**Category:** General Discussion\
**Created:** [February 6, 2020, 4:46pm UTC](https://forum.inductiveautomation.com/t/write-a-boolean-property-with-a-click-action-in-a-button/32002 "2020-02-06T16:46:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [February 6, 2020, 4:46pm UTC](https://forum.inductiveautomation.com/t/write-a-boolean-property-with-a-click-action-in-a-button/32002/1 "2020-02-06T16:46:49Z")

</div>

In early versions of Ignition 8.0.3 I was able to write a Boolean property from a button to another boolean property in any component . For example turn on or off a visibility of a rectangle.

On a button I wrote the script on mouse released Event Handlers.

```auto
if event.clickCount == 1:
  event.source.parent.getComponent('Rectangle').visible = 0

```

this works for 8.0.3. But now that I’m trying to perform the same in 8.0.8 I can’t make it work.

I tried writing “false” instead of 0 but nothing happens.  
I did the test with a toggle button using a binding to “selected” and It worked. What is happening??

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [February 6, 2020, 4:55pm UTC](https://forum.inductiveautomation.com/t/write-a-boolean-property-with-a-click-action-in-a-button/32002/2 "2020-02-06T16:55:08Z")

</div>

I’m sorry for waste your time. I did a gateway reset and now it’s working. Must’ve been a bug of 8.0.8

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [February 6, 2020, 5:12pm UTC](https://forum.inductiveautomation.com/t/write-a-boolean-property-with-a-click-action-in-a-button/32002/3 "2020-02-06T17:12:30Z")

</div>

Yes, your original code looks good. Note `True` / `False` require an initial capital:

```python
if event.clickCount == 1:
  event.source.parent.getComponent('Rectangle').visible = False

```
