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 / Filltering gallery usi...
Power Apps
Answered

Filltering gallery using dropdown / Gallery Views

(0) ShareShare
ReportReport
Posted on by

 

hi everyone,

 

i have setup a power app that rececives orders from MS forms - creates an item in this sharepoint list and then we action them.

 

i want to get better filtering my data, currently i have three seperate buttons one for new requests, one for orders complete, and one for out of stock - these buttons just filter the same sharepoint list  gallerys (sharepoint list) by a different view. 

 

i have just setup a dropdown list that filters the shift.

 

["1", "2", "3", "4" , "Days"]

 

SortByColumns(Filter([@'PPE Request (Footwear)'],Shift.Value = Dropdown2.Selected.Value && Status.Value = "On Order"), "ID", If(SortDescending1, Descending, Ascending))

 

I have two questions - is it possible to have a dropdown that says 'All' which i would set as the default, and selects all of the shifts?

 

and also is there a better way to use buttons or sliders to which between views of my gallery instead of having 3 seperate pages for new orders, out of stock, and competed orders? 

 

any help would be great,

 

thanks,

 

Jake

 

 

jakemorris_2-1619551358170.png

 

 

 

jakemorris_0-1619550848814.png

 

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @jakemorris 

    For your first question - set the Items property of your Dropdown to : 

       ["All", "1", "2", "3", "4" , "Days"]

     

    Set the Items property formula on your Gallery to :

    SortByColumns(
     Filter([@'PPE Request (Footwear)'],
     (Dropdown2.Selected.Value = "All" || Shift.Value = Dropdown2.Selected.Value) && 
     Status.Value = "On Order"
     ), 
     "ID", 
     If(SortDescending1, Descending, Ascending)
    )

      

    As for your second question, I would utilize a Gallery for the buttons.

    Place a vertical gallery on the screen (let's call it galOrderTypes) and set the Items property to:

    Table({disp:"Open Orders", Stat:"On Order", fill:SteelBlue},
     {disp:"Closed Orders", Stat:"Closed", fill:SandyBrown}, 
     {disp:"Out of Stock Items", Stat:"Out of Stock", fill:SkyBlue}
    )

    Change the Stat text to meet the values of your list Choice column values.

     

    Add a button to the Gallery and set the Text property to : ThisItem.disp

    Set the fill property of the button to ThisItem.fill

    Style the button as you like.

     

    Then, change the formula for the Gallery to:

    SortByColumns(
     Filter([@'PPE Request (Footwear)'],
     (Dropdown2.Selected.Value = "All" || Shift.Value = Dropdown2.Selected.Value) && 
     Status.Value = galOrderTypes.Selected.Stat
     ), 
     "ID", 
     If(SortDescending1, Descending, Ascending)
    )

     

    That should give you what you are looking for.

     

    I hope this is helpful for you.

  • jakemorris Profile Picture
    on at

    amazing, that worked perfectly - thank you so much - 

    (Dropdown2.Selected.Value = "All" || Shift.Value = Dropdown2.Selected.Value)
    Table({disp:"Open Orders", Stat:"On Order", fill:SteelBlue},
     {disp:"Closed Orders", Stat:"Closed", fill:SandyBrown}, 
     {disp:"Out of Stock Items", Stat:"Out of Stock", fill:SkyBlue}

    im trying to understand the logic behind both of these - i'll look around - thank you again! 🙂 

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @jakemorris 

    For the first one, it is all about the Boolean logic.

    A Filter function will iterate through the table provided as the first argument and apply your logic to get a true or false result.  If the result is false, then the record of the iteration will not be included in the resulting table.  If it is true, then it will be.

    So in the formula:

    (Dropdown2.Selected.Value = "All" || Shift.Value = Dropdown2.Selected.Value)

    If the dropdown is "All" then it really makes no difference what the second part of that is because it is OR'ed with a true.  True OR'ed with true or false will result in true...thus the record will be returned (i.e. "All")

    If it is not "All" then it will be false, so it is up to the second part to be true for the record to be included - in which case, the comparison to the value will either be true or false.

     

    The second is quite simple.  The Gallery needs a Table of Records to use.  In this case we are providing it.

    Table({disp:"Open Orders", Stat:"On Order", fill:SteelBlue},
     {disp:"Closed Orders", Stat:"Closed", fill:SandyBrown}, 
     {disp:"Out of Stock Items", Stat:"Out of Stock", fill:SkyBlue}

    This produces a table of three records.  Each record has three data columns, a disp (display - used for the button text), a Stat (used for the Filter formula value) and a fill (color that is used for the button).

     

     

  • jakemorris Profile Picture
    on at

    thank you, thats great insight! 

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard