Announcements
Hi all,
I have two databases, one is for parent and one is for the child. In parents database, I have a column named 'Code' while in child database, there's a column named 'childCode' which is the foreign key(related to 'Code' from parents database). Let say I have 5 records of code 'A1' and 3 records of 'B1' in child's database. How can I show this total number(or rather countrow) of each parents' child record in my gallery? I tried to use CountRows but seems just can't get it right. Hoping to get some inputs from you. Thanks guys.
Hi @Anonymous ,
It looks like this post is same as what you are looking for. Hopefully this helps! https://powerusers.microsoft.com/t5/Building-Power-Apps/How-show-number-of-children-in-parent-gallery-item/td-p/335309
Thanks,
Drew
If correctly understand your issue, your gallery items property should look like:
GroupBy(childTable, “childCode”,”Result”)
and inside the gallery put a label with the text property set to:
CountRows(ThisItem.Result)
Hope it helps !
Thanks for the feedbacks! I forgot to mention that I want to show that inside the parents' gallery. So I created a label and want that label shows the total number of child having that particular code. If I set the property to CountRows(childTable.childCode), the label will show the total number of all child(regardless the code), which is not what I want. I tried 'ThisItem.Code=childTable.childCode' but no success.
Thanks @dpoggemann . I saw that solution but is it possible if I dont want to have another gallery inside another gallery? Instead just one parents gallery with a label that shows the number of rows related to the child?
Thank you again!
@Anonymous ,
In this case, instead of using CountRows(childTable.childCode), use in label (inside parent gallery)- Text property:
CountRows(Filter(childTable,childCode=Thisitem.Code))
but this can cause loading delay on a large set of date as you'll distinctly interogate childTable for each parent Code.
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 342 Super User 2026 Season 2
M Bilal Khan 258
Mohsin Ali 231