# Trigger Bit if true

**URL:** <https://forum.inductiveautomation.com/t/trigger-bit-if-true/9715>\
**Category:** Ignition\
**Created:** [February 17, 2015, 1:17am UTC](https://forum.inductiveautomation.com/t/trigger-bit-if-true/9715 "2015-02-17T01:17:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [February 17, 2015, 1:17am UTC](https://forum.inductiveautomation.com/t/trigger-bit-if-true/9715/1 "2015-02-17T01:17:15Z")

</div>

I have 2 custom properties.

ChargedBit (Boolean)  
ChargedTime (String which has a query to display the current time)

Chargedbit is linked to a button.

When ChargedBit goes true i want to send ChargedTime to a tag called Charged Time-Date

I know it needs an if true statement but I cant figure it out and I’ve searched and cant find anything similar.

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [February 17, 2015, 2:16am UTC](https://forum.inductiveautomation.com/t/trigger-bit-if-true/9715/2 "2015-02-17T02:16:40Z")

</div>

This Python script needs to go into the propertyChange event of the button. Modify it as needed.

```auto
if event.propertyName == "ChargedBit":
	if event.newValue == True:
		system.tag.write("Charged Time-Date", event.source.ChargedTime)
```

Best,
