Transaction Groups - After writing new line get id number back

Hello,
is it possible with Transaction Group after entering new measurements/data (new rows in the SQL table) to get back the "id" value of the row ("id" is a parameter that is automatically generated/increased when a new value is entered)? Similar like in query in the picture?
Many thanks in advance for your replies,
David

image

Have a look at the getKey parameter in system.db.runNamedQuery | Ignition User Manual. I haven't tried it and don't know if it can be used with Transaction Group.

Yes, that works. But I would like to get "id" back inside Transaction Group.

If I first write the data to the DB with the Transaction Group (Standard Group) and then immediately make a query for runNamesQuery, it happens that I don't get the last "id" value. It's like that Transaction Group wrote to the DB later (with a delay).

Ignition uses DB connection pools, so the odds that a following, separate, query will use the same actual connection as the transaction group are very low. And retrieving the "last inserted ID" requires execution on the same actual DB connection.

You will need to switch to a script if this ID is critical to your application.

Thank you very much for the information. I implemented solution this way.