# Transaction Group Historical \> get index of last data inserted

**URL:** <https://forum.inductiveautomation.com/t/transaction-group-historical-get-index-of-last-data-inserted/35978>\
**Category:** Ignition\
**Tags:** database, ignition80\
**Created:** [June 24, 2020, 1:36pm UTC](https://forum.inductiveautomation.com/t/transaction-group-historical-get-index-of-last-data-inserted/35978 "2020-06-24T13:36:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tecnoeletronic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tecnoeletronic/32/50975_2.png) [@tecnoeletronic](https://forum.inductiveautomation.com/u/tecnoeletronic)\
**Post date:** [June 24, 2020, 1:36pm UTC](https://forum.inductiveautomation.com/t/transaction-group-historical-get-index-of-last-data-inserted/35978/1 "2020-06-24T13:36:05Z")

</div>

Hi,

i’m using a Transaction Group (Historical) to add data to a table and all works fine.  
Is there any way to get the autogenerated index using the same transaction?

---

<div class="post-metadata">

**Author:** ![kaushik.shah](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@kaushik.shah](https://forum.inductiveautomation.com/u/kaushik.shah)\
**Post date:** [June 24, 2020, 6:30pm UTC](https://forum.inductiveautomation.com/t/transaction-group-historical-get-index-of-last-data-inserted/35978/2 "2020-06-24T18:30:37Z")

</div>

Hmm, I was waiting for some good answers on this.

What we do is, trigger an expression item which executes scripting function. In the scripting function, have the update query with getKey = 1.
