Hello,
I'd like to get an advice for following scenario:
I have form with 2 text fields, which are distributed into 2 different tables via Integrator. So far so good. After the Integrator inserts the data, 2 different IDs in the tables are assigned to new rows.
Now, within the same submission of the form, I need to find out the ID given in first table (SELECT id FROM table1 WHERE column1='textfield1_content' AND column2='textfield2_content') and update it in column of the second table.
So far I have these ideas:
Option 1:
Integrator's Rule1 which inserts data into first table
Integrator's Rule2 which inserts data into second table
Integrator's Rule3 which updates referring ID in second table with ID's value returned by query above (I guess the query must be constructed in Code section of the Integrator mapping)
Option 2:
Integrator's Rule1 which inserts data into first table
Integrator's Rule2 (update type) which inserts data into second table and updates the referring ID by querying first table (as above)
Questions:
How do I construct the SQL query with values submitted in the form?
How do I ensure that first rule is executed before the second (which has to find the already existing ID)?
Are there any other options?
Thank you