insert_id

How to pass the last saved record ID from one ChronoForms data save action to another.

Overview

The issue occurs when needing to use the auto-generated ID from a first database save as a value in a subsequent save.
In the second data save action, use the Data Override feature to set the target field value to the variable containing the ID from the first save.

Answered
ChronoForms v6
so soevind 04 Nov, 2017
Hi

I have 2 data_save. Let's say data_save1 and data_save2.

I first save data_save1 and then i want to set the last saved ID from data_save1 into data_save2.
How can i do that ?
Max_admin Max_admin 05 Nov, 2017
Answer
In data_save2 you can use the "Data override" to set specific values for fields in the table, so let's say the field name is table_id, you can use:
table_id:{var:data_save1.id}
assuming the primary key of the table in "data_save1" is "id", but if the table is created using Chronoforms6 then the primary key is most probably "aid"

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.