delete children record from Parent Table

Hello!!

I have a Great parent table (weekly record) Parent(daily Record) table record associated with 5 different child table records(a,b,c,d,e,f) if i deleted the parent record, I want the related records to be deleted too, in this  table were  I hAve  all my totals Weekly based.

I'm try to use a BOT with ONLY DELETE, and run an action on rows where the the reference table is the Parent the referenced rows is this formula:

orderby(filter("a",[a]=[_THISROW].[date])[_thisrow],1)

and the referenced Action is DELETE .

The result is a list with the same value in different dates, but when i'm deleting the PARENT record is deleting the last record but not the record associate with the date.

Do you have any idea 

Thanks in Advance

Solved Solved
0 7 950
1 ACCEPTED SOLUTION

You can't reference the child records of a record that has just been deleted, because that data no longer exists!

What you have to do is set up a new custom "delete" action that just sets some data value to a column, which triggers a Bot to run, that deletes all child records first, then deletes the parent record last.

View solution in original post

7 REPLIES 7

In the child table you should have a column that references the parent table record. Make sure this column is set up as "Is part of". Whenever a parent record is deleted this will also delete the child records.

Or show us exactly how you have your bot set up, but I'm thinking you either have the bot set up on the child table referring back to the parent table, or the bot is set up for the parent table and you are trying to execute the action on the parent row vs the child rows.

Thank you for your time Markus!!

 I canโ€™t use โ€œis part of โ€œbecause the actual table is a side table weโ€™re Iโ€™m pulling all the totals from the childrenโ€™s tables (a,b,c,d,e)

Gran parent table(weekly report)โ€”>weekly totals 

parent table (daily)

a,b,c,d,e Table 

You can't reference the child records of a record that has just been deleted, because that data no longer exists!

What you have to do is set up a new custom "delete" action that just sets some data value to a column, which triggers a Bot to run, that deletes all child records first, then deletes the parent record last.

Hi Marc, I haven't tried so this is just a suggestion. [_THISROW_BEFORE] wouldn't work?

Here?

Marc_Dillon_0-1674096665505.png

Nope. Good thought though.

Untitled2.png exactly I'm trying to use a bot with a run an action on rows with this formula.

My problem is that I'm deleting the wrong record.

orderby(filter("server",[server]=[_THISROW].[date])[_thisrow],1)

For give you an example: I'm deleting the  last record with the same name in the list but not the actual record.

I'm sorry for my poor English 


@Marc_Dillon wrote:

that deletes all child records first, then deletes the parent record last.


+1

Top Labels in this Space