Hi All,
I am trying to insert data Name(Tbl_Names) and Address(Tbl_Address) from UI in two tables.
From community there is one of the suggestion like- send Both CDT into ProcessModel. Include Two Write to DataStore nodes, fist write Table1 to database and use the store values output to store value back into process variable for table1. Then use a script task to add the primary key from Table1 to your foreign key in table 1.
I have no clarity on above answer. I need more visual clarity on how to use exactly (i am new to Appian) Data Tabs (Input/output parameter) or script task.
My tables: tbl_Names(namId(pk),name), tbl_address(addressId,address,nameId(Fk))
Thanks,
Deepak
Discussion posts and replies are publicly visible
Hi Deepak,
Having CDT1 and CDT2 like in your use case. Something like this would do what you need.
The first Write To Data Store Entity, writes the parent row in the Database and capture the ID using the Stored Values property of the smart service.
Once that, you need to update the child CDT with the ID you generated.
Once that is done, you just need to perform a Write to Data Store Entity for your child CDT