It should have been recognized that the coping row including the child table/rows are currently not supported and possible.
However, I did find one way to do it. It works perfectly.
Before you read this post, make sure a prerequisite to use this tip is that you are on the business plan holder where you have access to Appsheet API.
What is behind the trick?
Basically, the trick is to retain the row ID of the original row and keep this id within the new row which was generated after the action. Dont select “Copy row and edit” for action. Just select “Data : Add a new row to another table using values from this row/” During this process, new row will contain the id of original row.
Set workflow to generate new set of the child rows originated from. Rather than “copy” the set of child row, add row by Appshee API.
Now we are able to select the set of the row in the child table using the “OriginalIDCopiedFrom” within the condition for select expression.
After selecting the set of original child records, then loop it though within Body template for the API call. Make sure to put “stamp” to new child record for the parent record row ID so that the parent/child relationship between new set of rows are established.
Please find the step by step guide.
For the table, you wish to copy a row, add new physical fields where we store the row ID of the original row to copy. For this senario, I will name the column as “OriginalIDCopiedFrom”. At the same time, let me name the ID column for this table, called “RowId”
Add action to this table. “For a record of this table” select the name of the table you do copy a row.
“Do this” ; Data : Add a new row to another table using values from this row
Table to add to ; This is a trick. Select the same table name.
Set these columns ;
Set the column you would like to copy from original row to new rows
///// IMPORTANT /////
“OriginalIDCopiedFrom” : “RowId”
By doing this, we are able to keep the track record from which particular row the new row are generated (copied)
Now move to the next step to create new Workflow rule.
I name this workflow as AddChild. Update event is set as ADD_ONLY
Fire this workflow conditionally. Add expression ; isnotblank([OriginalIDCopiedFrom])
Select action - Webhook. I omit the basic set up for API, but the important poinst are ’
@tsuji_koichi this is amazing. I was working on a slightly different permutation of this concept and although I’m probably going to go through some revisions, it makes sense to release it as-is now.
Thanks for your comment and post.
I will find time to read through your idea and docs throughly and revert with any comment to make it better and far more useful.
In terms of my techinique to copy the child table rows, It should be easy to twist around a bit to “delete” child row, along with deletion of the related parent table row etc.
Very simple question. My notion is to wrap up all the stuffs (as much as possible) at the front-end site, in this case, Appsheet, rather than working on the backend.
My database is always sitting on MS SQL. To do the same on the SQL, we need to write syntax, in this case, SQL trigger. I can ask my friend who are familiar with SQL and trigger etc, but I don’t want to bother my friend, haha.
Before Appsheet released full set of API, I have been using SQL trigger. Appsheet API can do most of the stuff, apart from one single thing.
I have placed a feature request and other community member posted the same as well. When we run third party API, GET request, then naturally it returns a response. Then we wish to read the response body and push data whichever we need into the Appsheet data source as target. Once this is achieved, then we can do more and more. I m just looking forward to it and hope Phil in Appsheet will find a time to implement this last thing!
That’s true… Something we’ve been needing as well… We currently make a push to AWS Cognito to add a user to the pool, and catching the response would be great!
If i dont have pro plan, just premium.
What can i use if i want to automatically (without user input or action), copy a row to the same sheet and edit the copy? Triggered by a ISNOTBLANK value in column. I’ve been trying for several days without luck.
Thank you so much @tsuji_koichi for this great trick!
Since this requires a business plan, and many like me don’t have it, what would be the alternative?
Is GAS function with trigger from Appsheet an option?
[Copy parent record together with child records ; Action Only, No API, No workflow](https://community.appsheet.com/t/copy-parent-record-together-with-child-records-action-only-no-api-no-workflow/27619) Tips & Tricks ?
After introducing a trick how to copy the related child records along with parent record through the post of Quite a few people have been asking me how to manage it without API, but actions only. Sharing this trick may get the Appsheet sales team angry with me, so I m bit reluctant to do so, as it may reduce the sales opportunities for business subscriptions … , but let me put it aside now, This is what I managed to achieve the same task, “copy parent record together with child …