Capture Auto Increment SQL Value and store in temporary state

I have this query.

INSERT INTO RPv3LPOpportunity
(CustomerId, OpportunityName, DateCreated, DateModified, Active, OpportunityDate, Amount) 
Values  ({{textInput1.value}}, {{textInput2.value}}, {{textInput3.value}}, {{textInput4.value}}, {{textInput5.value}}, {{textInput6.value}}, {{textInput7.value}})

Sql generates an auto incremented Id for this table RPv3LPOpportunity.OpportunityId I need to capture this upon row creation and store it to a temp value.

hey @nroeder ou should be able to access it by referencing the query {{queryName.data.}}

image
This is what I get.
Sorry not a programmer.

if you go into the output object, I imagine there will be the information you're looking for!

Assuming you want the ID of the row just inserted you can do the following:

Your query name is query1.

INSERT INTO RPv3LPOpportunity
(CustomerId, OpportunityName, DateCreated, DateModified, Active, OpportunityDate, Amount) 
Values  ({{textInput1.value}}, {{textInput2.value}}, {{textInput3.value}}, {{textInput4.value}}, {{textInput5.value}}, {{textInput6.value}}, {{textInput7.value}})
RETURNING your_auto_increment_id_column_name```

then to set your tempState var - in it's default value field add
`{{query1.data.your_auto_increment_id_column_name}}`