# Button change value to opc tag

**URL:** <https://forum.inductiveautomation.com/t/button-change-value-to-opc-tag/94033>\
**Category:** Maker\
**Tags:** perspective\
**Created:** [August 1, 2024, 12:08pm UTC](https://forum.inductiveautomation.com/t/button-change-value-to-opc-tag/94033 "2024-08-01T12:08:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darci\_Junior](https://avatars.discourse-cdn.com/v4/letter/d/7ab992/32.png) [@Darci\_Junior](https://forum.inductiveautomation.com/u/Darci_Junior)\
**Post date:** [August 1, 2024, 12:08pm UTC](https://forum.inductiveautomation.com/t/button-change-value-to-opc-tag/94033/1 "2024-08-01T12:08:53Z")

</div>

I need to adjust a button in perspective to communicate with an OPC boolean tag. I need the value of the tag to always be false, only when I click it becomes true (when I stop clicking it returns the value to false).

---

<div class="post-metadata">

**Author:** ![Alexi\_Andrzejewski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alexi_andrzejewski/32/65032_2.png) [@Alexi\_Andrzejewski](https://forum.inductiveautomation.com/u/Alexi_Andrzejewski)\
**Post date:** [August 1, 2024, 12:16pm UTC](https://forum.inductiveautomation.com/t/button-change-value-to-opc-tag/94033/2 "2024-08-01T12:16:36Z")

</div>

You may need to first bind the component with the props.text property of the button  
Then you add an onPointerDown event (ctrl+J) on your button wich write False in your specified tag  
And an onPointerUp event wich write True in the tag

However I think it would be easier to simply toggle the state by clicking the button

---

<div class="post-metadata">

**Author:** ![Samuel\_Sueur](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Samuel\_Sueur](https://forum.inductiveautomation.com/u/Samuel_Sueur)\
**Post date:** [August 1, 2024, 1:04pm UTC](https://forum.inductiveautomation.com/t/button-change-value-to-opc-tag/94033/3 "2024-08-01T13:04:55Z")

</div>

Hi @Darci_Junior ,

What you're trying to achieve would be referred to as a momentary button.

See this topic, a momentary button is NOT recommended:

> [@Momentary Button - Ignition Perspective 8.1](https://forum.inductiveautomation.com/t/momentary-button-ignition-perspective-8-1/80217):
>
> I am using Ignition Perspective 8.1 and we are starting to use this for some of our equipment as HMI's with a touchscreen PC. With that being said I was trying to use a "BUTTON" for starting a system and it appears that there is not an option for momentary. The button only has the ability to write to the tag and then needs to be reset. Does anyone know if this is correct. If so has anyone developed some reliable scripting to "create" a momentary button function. Currently we are using some PLC…
