Copy Parent and child records in one action. No API

timsimpson
Participant III

I’ve managed to develop a way of copying a row from a Parent table along with its Child records.

It uses a number of actions and a workflow, triggered when a new parent record is created.

It takes a few seconds to update the children as the app syncs, but the main functionality is there.

I’m going to be using it to copy the parent and child records so that it’s possible to create a historic record of reports that can be secured as un-editable for record keeping. By creating a new copy of the parent record, new details can be added and a new record created.

There will hopefully be umpteen other uses.

You can see a copy of the app here
Parent and child App

15 8 2,387
8 REPLIES 8

Awesome!!! I copied the app and trying to fully understand it and it may have been the thing I have been looking for and trying to get to work. Thank you very much for your sample app!!!

Jason

The process is a bit of a head scrambler. I’ve tried to a label all but the Prominent copy actions and the workflow in a numerical order so you can understand the order they occur in.

The workflow relies on the Parent record having a Trigger column that gets given values by the actions. This then fires the workflow, triggering more actions.
In addition The Old Parent is given a UNIQUIEID to assign to the New Parent’s Key column. When the New Parent is created it records its previous Old Parent Key. This ensures that the New Parent and Old Parent are linked and that an action to copy the child rows of the Old Parent can then give them references to the New Parent.

I’m not sure if this explains things any clearer but I hope it helps.

@Martin_Pace This is one, not the one I found earlier though

teambelair
Participant V

Thank you @timsimpson !

I implemented something similar. The user goes on the record to copy and press a button.

On the parent table to be copied I just added one field: “Duplicate_Copy_Of” which is your field “PreviousParent”.

On the behavior action to copy the children, the “Parent id” is retrieve with the expression: MAXROW("Class_Boards", "_RowNumber", ([Duplicate_Copy_Of] = [_THISROW].[Class_Board]))

I did not add the fields Trigger and NextParent, Workflow and actions related to the Trigger field.

The copy of the parents and its children is working fine. Am I not seeing a use case that will cause me problem in the future?

timsimpson Has created many Actions in your case how many actions we need to create and what exactly to enter in that please elaborate. Thank you 🙏😊

Ethan_U
Participant V

Hey Alex I’m quite new to the platform and I’m trying to create a purchasing app that can copy a master purchase order for a vendor which has child records that represent all of that vendor’s products. Since I want to maintain the master vendor record do I even need the field for “duplicate copy of” since I always want to copy the same record which is a master record along with it’s child record products in the catalog?

Hope my question is clear. seems like you nailed it and I was hoping to learn your method.

ihayek86
Participant I

nor working anymore
I do not know why
can you please help with this ?

Aurelien
Participant V

Hi @timsimpson,

Many thanks for sharing this app, very useful.
As I needed to understand how it works, and because automation/Bots came in the meantime, I adapted your app to the new method (very minor changes, you made a great work and provides nice explanations).

I take the liberty to share it here, in case that may be useful for anyone.
I mentioned your credit in the app description, of course

https://www.appsheet.com/samples?appGuidString=9da880c2-5bb9-45c5-b0a4-643273a1939c

Top Labels in this Space