# Writing to a Tag That Does Not Exist

**URL:** <https://forum.inductiveautomation.com/t/writing-to-a-tag-that-does-not-exist/112869>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [December 17, 2025, 4:15pm UTC](https://forum.inductiveautomation.com/t/writing-to-a-tag-that-does-not-exist/112869 "2025-12-17T16:15:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [December 17, 2025, 4:15pm UTC](https://forum.inductiveautomation.com/t/writing-to-a-tag-that-does-not-exist/112869/1 "2025-12-17T16:15:00Z")

</div>

If I’m writing to a list of say 5 tags and at any point in time any combination of them could exist or not exist, is there any penalty/issue with using `system.tag.writeBlocking()` to write to all 5 regardless of which one(s) exist? When I run it with a test tag that doesn’t exist in the script console it just returns bad not found. This shouldn’t cause any issues and the tags that do exist should be written with the correct value, right?

I should also note that some of these tags exist on other tag providers which also may or may not exist, which may actually be more of an issue because using a provider in the tag path that doesn’t exist does throw an error.

Curious to me that a tag that doesn’t exist on a provider that does exist is handled differently than just a provider that doesn’t exist

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 17, 2025, 4:50pm UTC](https://forum.inductiveautomation.com/t/writing-to-a-tag-that-does-not-exist/112869/2 "2025-12-17T16:50:06Z")

</div>

The decision of what to do when a write happens to a nonexistent tag path is made by the individual provider. While most of them probably do the same as the default local provider, there's no guarantee of that at the interface level - e.g. MQTT could do something different from the 'System' provider could do something different from a remote provider.

---

<div class="post-metadata">

**Author:** ![vtran](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vtran](https://forum.inductiveautomation.com/u/vtran)\
**Post date:** [December 17, 2025, 4:51pm UTC](https://forum.inductiveautomation.com/t/writing-to-a-tag-that-does-not-exist/112869/3 "2025-12-17T16:51:21Z")

</div>

Why not just check if the tag exists before writing to it using `system.tag.exists`?

[system.tag.exists | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-exists)

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [December 17, 2025, 5:08pm UTC](https://forum.inductiveautomation.com/t/writing-to-a-tag-that-does-not-exist/112869/4 "2025-12-17T17:08:49Z")

</div>

That would definitely be a solution. Remove it from the list if it doesn’t exist.

I’ve actually got these tag paths in a dict before making them in a list so I went ahead and used a filter because I know which ones I’ll have based on the providers that exist.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [December 17, 2025, 6:35pm UTC](https://forum.inductiveautomation.com/t/writing-to-a-tag-that-does-not-exist/112869/5 "2025-12-17T18:35:12Z")

</div>

This does take up time... if this is on the gateway itself then it'll be much faster. If this is something that is being written to on the HMI layer, I'm not sure I would recommend this as a solution.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [December 17, 2025, 7:36pm UTC](https://forum.inductiveautomation.com/t/writing-to-a-tag-that-does-not-exist/112869/6 "2025-12-17T19:36:48Z")

</div>

Agreed. I did not want to do a for loop to check if each tag exists and remove it from the list if it doesn’t.

For the record, this was my solution:

```python
area_tags = {
    1: ["[Area_01]Alarms/ALM_","[Area_01]Alarms/PLC14_ALM_"],
    5: ["[Area_05]Alarms/ALM_"],
    8: ["[Area_08]Alarms/ALM_","[Area_08]Vendor_Systems/IFAS_CP/Alarms/ALM_"],
    10: ["[Area_10]Alarms/ALM_","[Area_10]Alarms/PLC11_ALM_"],
    15: ["[Area_15]Alarms/ALM_"],
    17: ["[Area_17]Alarms/ALM_"],
    18: ["[Area_18]Alarms/ALM_"],
    19: ["[Area_19]Alarms/ALM_"],
    }
    
    stationArea = system.tag.readBlocking(['Areas/Station_Area'])[0].value
    
    #filter out tags if this is not the master
    if not stationArea == 0:
        area_tags = { key: value for key, value in area_tags.items() if key == stationArea}
    
    if reset:
        suffix = "Reset"
    else:
        suffix = "ACK"
 
        
        
    if not areas:
        tagsToWrite = [tag + suffix for tag_list in area_tags.values() for tag in tag_list]
    else:
        tagsToWrite = [tag + suffix for area,tag_list in area_tags.items() if area in areas for tag in tag_list]
    
    valsToWrite = [1 for tag in tagsToWrite]
    system.tag.writeBlocking(tagsToWrite, valsToWrite)

```
