# Tag change script execution

**URL:** <https://forum.inductiveautomation.com/t/tag-change-script-execution/114112>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [February 22, 2026, 2:14pm UTC](https://forum.inductiveautomation.com/t/tag-change-script-execution/114112 "2026-02-22T14:14:57Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![lane.duncan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lane.duncan/32/83700_2.png) [@lane.duncan](https://forum.inductiveautomation.com/u/lane.duncan)\
**Post date:** [February 24, 2026, 4:55am UTC](https://forum.inductiveautomation.com/t/tag-change-script-execution/114112/21 "2026-02-24T04:55:14Z")

</div>

Alternatively show the actual dataset values in the log.

---

<div class="post-metadata">

**Author:** ![svatsal77](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@svatsal77](https://forum.inductiveautomation.com/u/svatsal77)\
**Post date:** [February 24, 2026, 8:48am UTC](https://forum.inductiveautomation.com/t/tag-change-script-execution/114112/22 "2026-02-24T08:48:41Z")

</div>

I am manually doing it by opening the designer and modifying the existing dataset values from tag browser.

---

<div class="post-metadata">

**Author:** ![svatsal77](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@svatsal77](https://forum.inductiveautomation.com/u/svatsal77)\
**Post date:** [February 24, 2026, 8:49am UTC](https://forum.inductiveautomation.com/t/tag-change-script-execution/114112/23 "2026-02-24T08:49:38Z")

</div>

I'm on v 8.1.48  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/b/ebe1adf705275517c165b63f5632556da9d3ca70.png)

---

<div class="post-metadata">

**Author:** ![svatsal77](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@svatsal77](https://forum.inductiveautomation.com/u/svatsal77)\
**Post date:** [February 24, 2026, 8:59am UTC](https://forum.inductiveautomation.com/t/tag-change-script-execution/114112/24 "2026-02-24T08:59:29Z")

</div>

```python
def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
	
	if not initialChange and currentValue.value != previousValue.value:
		logger = system.util.getLogger('TagChangeExec_Test')
		logger.info('Exec')
		logger.info('initialChange : '+ str(initialChange) + ' currentValue.value : ' + str(currentValue.value))
		data = system.dataset.toPyDataSet(currentValue.value)
		for row in data:
			logger.info(str(list(row)))

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/5/f5907d84f79afbf17c25f8c926f154f1f8ad4f37.png)

```python

JSON tag
{
  "valueSource": "memory",
  "eventScripts": [
    {
      "eventid": "valueChanged",
      "script": "\t\n\tif not initialChange and currentValue.value !\u003d previousValue.value:\n\t\tlogger \u003d system.util.getLogger(\u0027TagChangeExec_Test\u0027)\n\t\tlogger.info(\u0027Exec\u0027)\n\t\tlogger.info(\u0027initialChange : \u0027+ str(initialChange) + \u0027 currentValue.value : \u0027 + str(currentValue.value))\n\t\tdata \u003d system.dataset.toPyDataSet(currentValue.value)\n\t\tfor row in data:\n\t\t\tlogger.info(str(list(row)))"
    }
  ],
  "dataType": "DataSet",
  "name": "Tag0",
  "value": "{\"columns\":[{\"name\":\"Col0\",\"type\":\"java.lang.Boolean\"},{\"name\":\"Col1\",\"type\":\"java.lang.String\"}],\"rows\":[[true,\"0\"]]}",
  "tagType": "AtomicTag"
}

```

---

<div class="post-metadata">

**Author:** ![lane.duncan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lane.duncan/32/83700_2.png) [@lane.duncan](https://forum.inductiveautomation.com/u/lane.duncan)\
**Post date:** [February 24, 2026, 9:52am UTC](https://forum.inductiveautomation.com/t/tag-change-script-execution/114112/25 "2026-02-24T09:52:09Z")

</div>

> [@svatsal77](#):
>
> I am manually doing it by opening the designer and modifying the existing dataset values from tag browser.

This is may be your issue. Designer may be writing to the tag twice...although I am unable to duplicate your issue in the 8.3 designer. 8.1 is a little different in regards to datasets, so my test is not a 1:1 comparison to your issue.

You should write some actual code on a test button. Do not use the tag editor for testing.

This code on my test button in 8.3:

```python
def runAction(self, event):
	import traceback
	logger = system.util.getLogger("dataset value change test")
	try:
		inDataset = system.tag.readBlocking(["[default]Tag0"], 1000)[0].value
		oldValue = inDataset.getValueAt(0,0)
		newValue = not oldValue
		newDataset = system.dataset.setValue(inDataset, 0, 0, newValue)
		system.tag.writeBlocking(["[default]Tag0"], newDataset, 1000)
	except: 
	    #Log any show stopping errors
	    message = traceback.format_exc()
	    system.perspective.print(message)
	    logger.error(message)

```

---

<div class="post-metadata">

**Author:** ![svatsal77](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@svatsal77](https://forum.inductiveautomation.com/u/svatsal77)\
**Post date:** [February 24, 2026, 11:29am UTC](https://forum.inductiveautomation.com/t/tag-change-script-execution/114112/26 "2026-02-24T11:29:56Z")

</div>

Yes, I implemented the logic at the button level, and now it executes only once.  
However, the double execution behavior still surprises me, because it only happens when working with _dataset_ tags. Other tag types do not trigger the script twice when edited directly from the Designer’s Tag Browser.

---

<div class="post-metadata">

**Author:** ![Nol](https://avatars.discourse-cdn.com/v4/letter/n/8e8cbc/32.png) [@Nol](https://forum.inductiveautomation.com/u/Nol)\
**Post date:** [February 24, 2026, 3:27pm UTC](https://forum.inductiveautomation.com/t/tag-change-script-execution/114112/27 "2026-02-24T15:27:30Z")

</div>

So I loaded up 8.1.48 and re-did the identical test I did in 8.3.2 and sure enough it fires twice now, same as OP is seeing. So it does seem like it's a bug related to that version that was fixed between then and 8.3.

However it specifically only happens when editing from the tag -editor-, if you go and drill down through the tag browser and change a value there it does not happen twice.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/e/4e4914513ba66e8da95730ee73274d4fb24069aa.png)

Edit: Looks like the tag editor is just doing some stupid stuff. I did a test where all I did was add a space to a comment in the tag change and it executes 3 times. So, yeah.

[Previous page](https://forum.inductiveautomation.com/t/tag-change-script-execution/114112.md?page=1)
