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 / Filter 2nd Gallery By ...
Power Apps
Answered

Filter 2nd Gallery By Parent ID

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi All,

 

I am struggling with the following, can anyone offer any help?

 

I have two SP lists,list one is Incidents and list two is Updates to incidents. We create a new incident in Powerapps (no issue there), which sit in a Gallery(Gallery1) and we add an update to the incident by adding a new record to the updates list, which sees the ParentID of the incident itself, by use of a lookup within a dropdown.

 

What we are trying to do is have a second Gallery displaying all of the updates, linked to the Incident, so we could see all updates related to the ParentID. We're struggling to get the filter to work on Gallery2, whereby it only shows the filtered results.

 

Could anyone offer any advice on how the filter should work?

 

Many Thanks

Categories:
I have the same question (0)
  • Verified answer
    CarlosFigueira Profile Picture
    Microsoft Employee on at

    You can reference the selected item in the first gallery (Selected property) from the Items property of the second gallery, where you can apply the filter. Something along the lines of the expression below:

    Gallery2.Items: Filter(Updates, ParentID = Gallery1.Selected.ID)

    Notice that the Filter function can be composed with other functions as well, such as sorting the updates based on their date, for example:

    Gallery2.Items:
     SortByColumns(
     Filter(Updates, ParentID = Gallery1.Selected.ID),
     "CreateTime",
     Ascending))

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you, but that doesn't seem to work. I think the problem is with how the ParentID is pulling through, so its not seeing the ParentID correctly. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you, I managed to get this working.

  • LM-09051110-0 Profile Picture
    on at

    Where do you enter this filter? I assume its in the DATA section and I assumed it was the Items value...but it doesnt recognise the .items command. Sorry I am knew to power Apps and this is driving me nuts...I want to create the three nested tables which show 3 different activity gallerys when you select the parent project from the 1st gallery...but It currently shows all acitivities irrespective of the project selected. I appreciate above is probably the solution, but I have no idea how I implement it!

     

    File attached...and help would be massively appreciated!!!

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 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard