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

Community site session details

Session Id : bdmzy+C3ow8guyQ6snmaCR
Power Apps - Building Power Apps
Answered

Filter Gallery Based On Field Value

Like (1) ShareShare
ReportReport
Posted on 8 Jan 2018 14:36:50 by

Hi,

 

I have a scenario in which I have 3 seperate galleries on one page (see below). 1 gallery is to show Pending, 1 to show Rejected and 1 to show Approved requests. I have a SharePoint list with a Request Status column also which is a 'Choice' field with options of Pending, Rejected and Approved. 

 

I am trying to make a filter for each gallery to show to respective requests as demonstrated below. Can anyone advise of the logic for the filter? 

 

Leave Gallery.JPG

 

Thanks

 

Craig

I have the same question (0)
  • strategery Profile Picture
    179 on 08 Jan 2018 at 14:59:29
    Re: Filter Gallery Based On Field Value

    When you initially create the gallery you choose the datasource. I'll assume you've already done that, and I will attempt to fill in some blanks by assuming what you want to show is something like an employee name?

     

    Assume your Sharepoint list is named "SharePointList",

    assume you have a column in the list for "Name" which is what you wish to show in the gallery,

    and the column you've already mentioned "Request Status".

     

    Select the gallery, change the "Items" to be this for "Pending" as an example:

    Filter(SharePointList,'Request Status'="Pending").Name

     

    "Filter" gives all records with Request Status = Pending, add .Name at the end so the gallery knows which field you wish to display.

  • Verified answer
    Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on 08 Jan 2018 at 15:34:04
    Re: Filter Gallery Based On Field Value

    In the Items property of each of the galleries try this:

     

    Filter([SP Data Source], RequestStatus.Value = "Pending") - change the status value for each of the galleries

     

    Now this may not be the best solution because you will get a blue dot indicating that this function can't be delegated. Choice columns can't be delegated in SharePoint, so it will only be able to run against the first 500 records and you will probably take a little performance hit.

     

     

  • Scott0044 Profile Picture
    137 on 11 Dec 2020 at 14:47:02
    Re: Filter Gallery Based On Field Value

    @Jeff_Thorpe wrote:

    Filter([SP Data Source], RequestStatus.Value = "Pending")

    Wonderful!  Thanks for this!  I'm trying to get this to work with my original 'Items' code that sorts the gallery by created date.  And allows the search of a few fields.  But I can't figure out how to inject your code to get everything packaged together neatly.  Any insight?  TIA  

     

    SortByColumns(Filter(Tickets, TextSearchBox1.Text in 'Assigned To'.DisplayName || TextSearchBox1.Text in Details || TextSearchBox1.Text in 'Created by'.DisplayName), "Created", If(SortDescending1, Descending,Ascending))

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 714 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 419 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 243

Last 30 days Overall leaderboard
Loading complete