Copying records in a child table based on a new parent record ID

Hi 

I have an action that successfully copies a row in a products table to the products table and then another grouped action that gets the new row Id,  and the copied record ID ,these are then saved in another table.

I am then trying to copy the existing child records linked to the original product ID that was copied and add them to the child table with the new copied product ID.

I could probably do this with an SP and a trigger but I assume that this is possible within appsheet

Any help or pointers gratefully received.

 

0 2 90
2 REPLIES 2

So if you already have access to the copied row id and the new row id why not create an automation step that adds a record to another table (child table of new copied product) and set the reference column to the new row id? Might be helpful to know how your copy action works and the grouped action for getting the relevant IDs. I suspect you should be able to include the new child rows action somewhere within your grouped action sequence.

Hi Markus

I have a products table, a child table called Product Assemblies and a table called SPProducts

I am using an action to copy and insert into the Products field using the add a row to a new table using values for this row

I then have another  action that uses the same action type using these values
ProdID = ProductID
CopiedProdID = MAXROW("Products", "Updated")
Into the SPProducts table 

So I need to figure out how to select the rows in the Product Assemblies table using the ProdID  and insert them into the same table with the new CopiedProdID so that they will appear as ref rows for the copied product.

Top Labels in this Space