# Block Transaction Group Block ID

**URL:** <https://forum.inductiveautomation.com/t/block-transaction-group-block-id/8738>\
**Category:** Ignition\
**Created:** [July 16, 2014, 6:13pm UTC](https://forum.inductiveautomation.com/t/block-transaction-group-block-id/8738 "2014-07-16T18:13:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![TimOSullivan](https://avatars.discourse-cdn.com/v4/letter/t/45deac/32.png) [@TimOSullivan](https://forum.inductiveautomation.com/u/TimOSullivan)\
**Post date:** [July 16, 2014, 6:13pm UTC](https://forum.inductiveautomation.com/t/block-transaction-group-block-id/8738/1 "2014-07-16T18:13:57Z")

</div>

Hi,  
I’ve a Block TG that inserts a block and another that I want to use to update the block periodically afterwards.

How do I get the Block ID from the first insertion?  
I want to use it in a custom ‘where’ clause in the block update TG.

Do I need to have a separate query for this?  
Thanks,  
Tim

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [July 16, 2014, 7:11pm UTC](https://forum.inductiveautomation.com/t/block-transaction-group-block-id/8738/2 "2014-07-16T19:11:21Z")

</div>

Yeah, unfortunately your only real option is probably to use an expression item in the second block that runs a “select max(blockid) from table”. I say “unfortunately” because this doesn’t work well if you’ve got multiple sets of groups trying to use the same table. If it’s just one pair, though, it should be fine.

Regards,

---

<div class="post-metadata">

**Author:** ![TimOSullivan](https://avatars.discourse-cdn.com/v4/letter/t/45deac/32.png) [@TimOSullivan](https://forum.inductiveautomation.com/u/TimOSullivan)\
**Post date:** [July 17, 2014, 11:33am UTC](https://forum.inductiveautomation.com/t/block-transaction-group-block-id/8738/3 "2014-07-17T11:33:41Z")

</div>

Thanks Colby,

I’m storing multiple sets for a lot of equipment.  
I’ve included a unique BatchID in each block and use this in an expression to return the BlockID.  
Works perfect.

Thanks,  
Tim

---

<div class="post-metadata">

**Author:** ![TimOSullivan](https://avatars.discourse-cdn.com/v4/letter/t/45deac/32.png) [@TimOSullivan](https://forum.inductiveautomation.com/u/TimOSullivan)\
**Post date:** [July 17, 2014, 8:20pm UTC](https://forum.inductiveautomation.com/t/block-transaction-group-block-id/8738/4 "2014-07-17T20:20:14Z")

</div>

Colby,  
I’m using a memory tag to handshake between 2 groups.  
The Insert group sets the tag to 1 when complete.  
This triggers the Update group which resets the tag to 0 when complete.

Is there any issue using a memory tag like this? (scan class etc.)

I noticed, on one occasion, that the tag didn’t reset to 0.  
It may have been because I was making a modification around the same time, but I’m just curious about using a memory tag in this manner.

Thanks,  
Tiim

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [July 17, 2014, 8:28pm UTC](https://forum.inductiveautomation.com/t/block-transaction-group-block-id/8738/5 "2014-07-17T20:28:38Z")

</div>

Hi,

No, there shouldn’t be any big problems, the scan class won’t come into play much, as the values get set right away on memory tags.

Are the groups set to only execute once on trigger? Otherwise, I don’t quite know why the tag wouldn’t get reset… try watching it a bit, and if you can figure out a sequence leading to this, we can take a look.

Regards,

---

<div class="post-metadata">

**Author:** ![TimOSullivan](https://avatars.discourse-cdn.com/v4/letter/t/45deac/32.png) [@TimOSullivan](https://forum.inductiveautomation.com/u/TimOSullivan)\
**Post date:** [July 18, 2014, 12:35pm UTC](https://forum.inductiveautomation.com/t/block-transaction-group-block-id/8738/6 "2014-07-18T12:35:59Z")

</div>

This hasn’t happened since.  
I put the group on a continuous trigger overnight (off a PLC timer) and trend the reset flag.  
Worked fine.

I’m putting it down to operator (me) error.
