# Creating alarms using scripting

**URL:** <https://forum.inductiveautomation.com/t/creating-alarms-using-scripting/92735>\
**Category:** Ignition\
**Tags:** ignition81, perspective, scripting\
**Created:** [July 3, 2024, 9:15am UTC](https://forum.inductiveautomation.com/t/creating-alarms-using-scripting/92735 "2024-07-03T09:15:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Purushothaman\_R](https://avatars.discourse-cdn.com/v4/letter/p/8797f3/32.png) [@Purushothaman\_R](https://forum.inductiveautomation.com/u/Purushothaman_R)\
**Post date:** [July 3, 2024, 9:15am UTC](https://forum.inductiveautomation.com/t/creating-alarms-using-scripting/92735/1 "2024-07-03T09:15:07Z")

</div>

table { border: 1px solid #c4c7c5; border-radius: 4px; font-size: 16px; } th { padding: 18px 16px; text-align: left; } td { padding: 16px; border-top: 1px solid #c4c7c5; } .katex-mathml{ display: block; text-align: center; } .katex-html { display: none; }

Hello Guys

I’m currently working on a project where I need to dynamically create alarms. I’ve set up a UDT instance in Ignition Edge and am transmitting data to standard Ignition. In my project, I have 14 folders, each containing identical tags that require alarm configuration.

To streamline this process, I’m looking for a way to automate the alarm configuration instead of manually setting it up for each tag. I attempted to use the `system.tag.configure` function, but I encountered a `BadAccessDenied` error, indicating as Insufficient Tag Provider Edit Permissions. This issue persists even when I use admin credentials.

Does anyone have suggestions on how to resolve this or alternative methods for dynamically creating alarms? Any help would be greatly appreciated. Thanks in advance!

> baseTagPath = "[MQTT Engine]Edge Nodes/MxD/Chicago/Assembly Area01/Line01/Stn1/Health Check/Fault/Current Fault"
> 
> alarms = [  
> {  
> "name":"My scripting alarm",  
> "mode":"AboveValue",  
> "setpointA":10  
> }  
> ]  
> tags = [  
> {  
> "alarms":alarms,  
> "name":"myTag"  
> }  
> ]
> 
> collisionPolicy = "m"
> 
> system.tag.configure(baseTagPath, tags, collisionPolicy)

I have tried using this script as i mentioned i got error stating "[Bad\_AccessDenied("Insufficient Tag Provider Edit Permissions"

---

<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:** [July 3, 2024, 1:41pm UTC](https://forum.inductiveautomation.com/t/creating-alarms-using-scripting/92735/2 "2024-07-03T13:41:00Z")

</div>

Make sure your permissions are set correctly on the edge install.

Also, why not just configure alarms in the UDTs?

---

<div class="post-metadata">

**Author:** ![Chris\_Bingham](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@Chris\_Bingham](https://forum.inductiveautomation.com/u/Chris_Bingham)\
**Post date:** [July 3, 2024, 2:48pm UTC](https://forum.inductiveautomation.com/t/creating-alarms-using-scripting/92735/3 "2024-07-03T14:48:08Z")

</div>

If you are looking for a way to update the tags programmatically, it would be worth chasing the error you are receiving. Tag provider permissions within the Edge gateway config might be a starting point...

I would also recommend following the examples in Ignition docs for [system.tag.configure](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-configure#code-examples) in which you read the configuration of a tag, modify a specific item in the config, then write the entire config back to the tag. My preference is to also read the config of a known-good tag (which was modified using the Tag Edit UI within Designer), then extract specific key:value pairs from that 'model tag' to assign to 'target tag' props.
