Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

deleting associated records as deleting the parent record

Posted on by 69
Hello all, 
 
I have been building a multi screen app and all the screens are connected with each other in the SQL Server Database. Think it as a tree structure, so A > B > C > D > E > F, in this case A is the parent of all and B is child of A and C is child of B etc...
 
What i do want to achieve is when I delete a Parent Record for example C, I would like to automatically delete  D,E,F also. so to achieve this i used this formula but it works for the parent but not for the child;
 
// Remove the selected article
Remove(Articles, ExistingArticle_Gallery.Selected);
 
// Remove associated records in ArticlesLookup
RemoveIf(Article_Volumes, Article_Parent_LookUp_ID = ExistingArticle_Gallery.Selected.Article_ID);
 
does any of you know a solution to this?
 
Thanks in advance
  • Verified answer
    Pstork1 Profile Picture
    Pstork1 64,090 on at
    deleting associated records as deleting the parent record
    To do this you need to make sure you remove the child records BEFORE removing the parent records. So the code you are using should work, but it needs to be in the reverse order.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard