web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Update Parent List Qua...
Power Apps
Unanswered

Update Parent List Quantity Column with Child Modification or Deletion

(0) ShareShare
ReportReport
Posted on by 173

Hi,

I have an application where I create Sale Order (Parent) and then on other Screen I create that Sale Order Lines (Childs).

I have 2 Lists
1) SaleOrderList (Parent List)
2) LineOrderList (Child List)


As I am passing the Parent List (ID) column in a column (ParentListID) of Child List.

In Child Screen I can have multiple lines of that same sale order and so that I enter Quantity for those lines in PowerApps and after pressing on save I Patch those child lines in Child List and also Update that Parent List (Total Quantity)  column with a sum of those child quantity this is working fine,

Problem:
but when I delete those lines from PowerApps Screen and again save it deletes those records from the child list but its not updating the Parent List  (Total Quantity) column with null or 0 ( as if there are no child records, so the sum should be zero) but the Parent List is showing that (OLD Quantity SUM) which was saved before using patch.


Any help??
@WarrenBelz 

Categories:
I have the same question (0)
  • AnthonyD Profile Picture
    559 on at

    Hello,

     

    After deleting child records. Do a patch on the parent record:

    Lets say varParentRecord is the parent record you have selected.

    Patch(SaleOrderList, varParentRecord , {AmountOfChildRows: CountRows(Filter(LineOrderList ,ParentID = varParentRecord.ParentID))})

    If you have a One To Many RelationShop you could even do the following:

    Patch(SaleOrderList, varParentRecord , {AmountOfChildRows: CountRows(varParentRecord.LineOrderList) })

    Please accept this answer as a solution if this answer solved your question.

    Best Regards,
    Anthony

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 426

#2
WarrenBelz Profile Picture

WarrenBelz 381 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 315 Super User 2026 Season 1

Last 30 days Overall leaderboard