Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

How to filter a Gallery of one Sharepoint List based on a value in a 2nd list.

(0) ShareShare
ReportReport
Posted on by

I have created a gallery and want to filter it based on a value in a related list.  

 

The primary list is named TicketList and contains a column named TicketStatus which is a lookup column to the StatusList list.  The StatusList list includes a column named Open which is a binary column.

 

I want to filter the gallery to only include those TicketList items which have a TicketStatus that is set to Open=true in the StatusList list.

 

 

  • Ami K Profile Picture
    Ami K 15,655 on at
    Re: How to filter a Gallery of one Sharepoint List based on a value in a 2nd list.

    @OldDogNewTricks thanks that is clearer.

     

    You can leverage the (non-delegable) Add Columns function to achieve this:

     

    With(
     {
     _modified_data: AddColumns(
     TicketList,
     "status_text",
     TicketStatus.Value
     )
     },
     With(
     {
     _data: AddColumns(
     _modified_data,
     "isOpen",
     LookUp(
     StatusList,
     StatusList[@Status] = _modified_data[@status_text],
     Open
     )
     )
     },
     Filter(
     _data,
     isOpen
     )
     )
    )
    
  • Re: How to filter a Gallery of one Sharepoint List based on a value in a 2nd list.

    @Amik It's not quite that straight forward.  "Open" is a binary column of the list StatusList (See the attached).

     

    I'm interested in filtering the value in another list that is a lookup to the StatusList for each item that has a value that is flagged as open (the Open Column is true).

  • Ami K Profile Picture
    Ami K 15,655 on at
    Re: How to filter a Gallery of one Sharepoint List based on a value in a 2nd list.

    @OldDogNewTricks - I might be reading this too simply, but have you considered using:

     

    Filter(
     TicketList ,
     TicketStatus.Value = "Open"
    )
    

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,691

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 65,019

Leaderboard