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 / Gallery Issues for fil...
Power Apps
Answered

Gallery Issues for filter and searching

(0) ShareShare
ReportReport
Posted on by 50

Hi, I have a Power App and am having issues with my Gallery.  My Gallery Items function is, Sort('Safety Observations', 'Date of Incident', SortOrder.Descending) so I can have my items in descending order. I have been trying to add a filter or search function and any time I add any other functions to my Gallery Items, I have errors.

 

What I want to do is add a drop down for the Reported By entries using this function, Distinct('Safety Observations','Reported By') but how do I add this to my Gallery Items?

 

Looking for any and all help!

Categories:
  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    Hi @anyegaard ,

     

    The below expression assumes:

     

    • The "Reported By" column is a People column
    • Your data source is SharePoint
    • Your dropdown control (where you have applied the Distinct function) is a Combo Box control

     

    Sort(
     Filter(
     'Safety Observations',
     Len('Your Combo Box'.Selected.Value) = 0 || 'Reported by'.DisplayName = 'Your Combo Box'.Selected.Value
     ),
     'Date of Incident',
     SortOrder.Ascending
    )

     

     

     

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • anyegaard Profile Picture
    50 on at

    The Reported By field is actually a text field. Does the function above still apply?

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    For a single line text field, you do not need to include 'DisplayName':

     

    Sort(
     Filter(
     'Safety Observations',
     Len('Your Combo Box'.Selected.Value) = 0 || 'Reported by' = 'Your Combo Box'.Selected.Value
     ),
     'Date of Incident',
     SortOrder.Ascending
    )

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • anyegaard Profile Picture
    50 on at

    Thank you! This works! One last question that you may know, is there a way to have the gallery default to all of the list items until a name is selected in the drop down box?

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @anyegaard  - the expression provided above should do exactly that. If the Combo Box is blank/empty, then the Gallery should be displaying all items.

     

    Is that not the case?

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • anyegaard Profile Picture
    50 on at

    No its defaulting to the first name within the list. Do you think this would be easier if I used a search box instead of a combo box or is there a way to default to all items?

    Thank you!

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @anyegaard the expression returns the first name in the list in the Gallery? Could you share a screenshot because I do not understand.

  • anyegaard Profile Picture
    50 on at

    The screen shots below show what the app is defaulting to when it opens. That individual is the first within the drop down.

    anyegaard_0-1686343721345.png

    anyegaard_1-1686343774846.png

     

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @anyegaard - sorry still not clear.

     

    The expression I provided was for your Gallery Items - the expression has no impact/dependency on your Combo Box control because they are unrelated/separate controls.

     

    If the Combo Box is defaulting to the first Item in your Data Source, it has nothing to do with the expression. You're saying this only started to happen after you updated the Gallery Item with the expression I suggested?

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

     

     

     

     

  • anyegaard Profile Picture
    50 on at

    No, it was happening the entire time. I’m just curious how to default it to all items. There’s currently no functions for the combo box  just unsure why this is happening 

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard