# 'How to' transaction group

**URL:** <https://forum.inductiveautomation.com/t/how-to-transaction-group/11710>\
**Category:** General Discussion\
**Created:** [May 23, 2016, 11:25pm UTC](https://forum.inductiveautomation.com/t/how-to-transaction-group/11710 "2016-05-23T23:25:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jose.ramirez](https://avatars.discourse-cdn.com/v4/letter/j/7feea3/32.png) [@jose.ramirez](https://forum.inductiveautomation.com/u/jose.ramirez)\
**Post date:** [May 23, 2016, 11:25pm UTC](https://forum.inductiveautomation.com/t/how-to-transaction-group/11710/1 "2016-05-23T23:25:55Z")

</div>

Hi all,

I want to map a Db table providing equipment active alarms into ignition tags.

The db table contains, around 5 (equipment) x 80 (alarms) = 400 rows  
The table would always have all 400 rows, the Active field will change 0/1 to indicate active alarm.

The idea is to have 5 instances of ‘equipmentAlarm’ datatype. The datatype would contain 80 fields, 1 per alarm and I want to drive the alarm condition from an ‘Active’ column on the Db. Other columns will be used to customize the alarm (Display path, ActivePipeline, ActivationDelay, etc)

## EquipmentId AlarmId Active [… other columns]

Equipment\_A Alarm\_1 0   
Equipment\_A Alarm\_2 0   
Equipment\_A Alarm\_3 0   
Equipment\_A Alarm\_4 0   
Equipment\_A Alarm\_5 0   
Equipment\_A Alarm\_6 1   
Equipment\_A Alarm\_7 0   
Equipment\_A Alarm\_8 0   
Equipment\_A Alarm\_9 0   
Equipment\_A Alarm\_10 0   
Equipment\_B Alarm\_1 1   
Equipment\_B Alarm\_2 1   
Equipment\_B Alarm\_3 0   
Equipment\_B Alarm\_4 0   
Equipment\_B Alarm\_5 0   
Equipment\_B Alarm\_6 0   
Equipment\_B Alarm\_7 0   
Equipment\_B Alarm\_8 0   
Equipment\_B Alarm\_9 0   
Equipment\_B Alarm\_10 0

Is there an efficient way to accomplish this with transaction groups? I don’t want to end up creating 400 transaction groups. The goals is to minimize the queries to the DB (max 1 per equipment)

Cheers!

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 24, 2016, 12:08am UTC](https://forum.inductiveautomation.com/t/how-to-transaction-group/11710/2 "2016-05-24T00:08:05Z")

</div>

Interesting. I would create a dataset tag with a query that grabs the entire table on every scan. And then use a tag change event to fan out the data to your UDTs. Which would then be memory tags. Use system.tag.writeAll() to maximize the speed.

---

<div class="post-metadata">

**Author:** ![jose.ramirez](https://avatars.discourse-cdn.com/v4/letter/j/7feea3/32.png) [@jose.ramirez](https://forum.inductiveautomation.com/u/jose.ramirez)\
**Post date:** [May 24, 2016, 10:34pm UTC](https://forum.inductiveautomation.com/t/how-to-transaction-group/11710/3 "2016-05-24T22:34:25Z")

</div>

yeah I was testing a similar approach using a project script.

In fact, I ended up using just a dataset to query the alarms and a UDT with lookups to that dataset to bind the alarm properties.  
I used project script to Add/Remove tags (from that Alarm UDT) to maintain the tags as rows are added/removed from the db.

thanks!
