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 Gallery with A-...
Power Apps
Unanswered

Filter Gallery with A-Z sequence and filter all records in gallery

(0) ShareShare
ReportReport
Posted on by 26

Hi, I need help filtering a Gallery of users with an A-Z sequence and all records in the gallery from a person field combo box. 

The filter I have works except it only filters the person with the last name selected in the A-Z gallery. 

 

I need this filter on the people picker to filter all gallery records so they can see any person regardless of their last name. 

DdPersonPP.Selected

 

I tried to set the Default of the 'GalleryA-Z' to blank {}, but then no records at all show when the page loads and I need some people to show up, so the first item A in the gallery works. 

 

Any suggestions are appreciated. Let me know if you need clarification. 

__________________________________________________________________________________

SortByColumns(
Filter(
Employees,
StartsWith(
Person0,
'GalleryA-Z'.Selected.LabelLetter.Text
) && (Category.Value = DdEmployee.Selected.Value || DdEmployee.Selected.Value = Blank()) && (Status.Value = DdStatus.Selected.Value || DdStatus.Selected.Value = Blank()) && ('AD Id'.DisplayName = DdPersonPP.Selected.DisplayName || DdPersonPP.Selected.DisplayName = Blank())
),
"Person0",
SortOrder.Ascending
)

Categories:
I have the same question (0)
  • Prabhakar_S Profile Picture
    735 Moderator on at

    Hi @Therese1 ,

     

    Please try this formula,

     

    ClearCollect(
    FilteredEmployees,
    Filter(
    Employees,
    (Category.Value = DdEmployee.Selected.Value || IsBlank(DdEmployee.Selected.Value)) &&
    (Status.Value = DdStatus.Selected.Value || IsBlank(DdStatus.Selected.Value)) &&
    ('AD Id'.DisplayName = DdPersonPP.Selected.DisplayName || IsBlank(DdPersonPP.Selected.DisplayName))
    )
    );

    SortByColumns(
    FilteredEmployees,
    "Person0",
    SortOrder.Ascending
    )

     

    Thanks!!! 

  • Therese1 Profile Picture
    26 on at

    I do not see where this solution included the filter by alphabetical sequence.  Also, the data is direct from SharePoint and not in a collection.   

  • Therese1 Profile Picture
    26 on at

    I was hoping for a way to change the filter to not filter by the GalleryA-Z if the DdPersonPP.Selected.DisplayName is not blank. 
    Something like this but this does not work. 
    SortByColumns(
    Filter(
    Employees,
    If(
    IsBlank(DdPersonPP.Selected.DisplayName),
    true,
    StartsWith(
    Person0,
    'GalleryA-Z'.Selected.LabelLetter.Text
    ) && (Category.Value = DdEmployee.Selected.Value || DdEmployee.Selected.Value = Blank()) && (Status.Value = DdStatus.Selected.Value || DdStatus.Selected.Value = Blank()) && ('AD Id'.DisplayName = DdPersonPP.Selected.DisplayName || DdPersonPP.Selected.DisplayName = Blank())||
    If(
    IsBlank(DdPersonPP.Selected.DisplayName),
    true,
    (Category.Value = DdEmployee.Selected.Value || DdEmployee.Selected.Value = Blank()) && (Status.Value = DdStatus.Selected.Value || DdStatus.Selected.Value = Blank()) && ('AD Id'.DisplayName = DdPersonPP.Selected.DisplayName || DdPersonPP.Selected.DisplayName = Blank())
    ),
    "Person0",
    SortOrder.Ascending
    ))

     

  • WarrenBelz Profile Picture
    156,275 Most Valuable Professional on at

    Hi @Therese1 ,

    As per the PM you sent - this may be what you are trying to do

    SortByColumns(
     Filter(
     Employees,
     (
     (
     Len(DdPersonPP.Selected.DisplayName) = 0 && 
     StartsWith(
     Person0,
     'GalleryA-Z'.Selected.LabelLetter.Text
     )
     ) ||
     'AD Id'.DisplayName = DdPersonPP.Selected.DisplayName
     ) &&
     (
     Category.Value = DdEmployee.Selected.Value || 
     Len(DdEmployee.Selected.Value) = 0
     ) && 
     (
     Status.Value = DdStatus.Selected.Value || 
     Len(DdStatus.Selected.Value) = 0
     ) 
     ),
     "Person0",
     SortOrder.Ascending
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Therese1 Profile Picture
    26 on at

    Hi Warren, 

    Thank you for the suggestion, but it did not work for some reason.  I did get the filter to work by setting the variable when I needed to search the (A-Z) Sequence in the text field, and adding an if scenario so I could filter both ways when needed.  This may not be the right way, but it seems to work so far although I can't figure out how to sort ascending the 2nd filter option.   

    ______________________________________________
    With(
    {
    _items: SortByColumns(
    Filter(
    Employees,
    (Category.Value = DdEmployee.Selected.Value || DdEmployee.Selected.Value = Blank()) && (Team.Value = Ddteams.Selected.Value || Ddteams.Selected.Value = Blank()) && (Status.Value = DdStatus.Selected.Value || DdStatus.Selected.Value = Blank()) && ('AD Id'.DisplayName = DdPersonPP.Selected.DisplayName || DdPersonPP.Selected.DisplayName = Blank())
    ),
    "Person0",
    SortOrder.Ascending
    )
    },
    If(
    varSearch = "Not",
    Filter(
    _items,
    StartsWith(
    'Person (Person0)',
    'GalleryA-Z'.Selected.LabelLetter.Text
    ) && (Category.Value = DdEmployee.Selected.Value || DdEmployee.Selected.Value = Blank()) && (Team.Value = Ddteams.Selected.Value || Ddteams.Selected.Value = Blank()) && (Status.Value = DdStatus.Selected.Value || DdStatus.Selected.Value = Blank()) && ('AD Id'.DisplayName = DdPersonPP.Selected.DisplayName || DdPersonPP.Selected.DisplayName = Blank())
    ),
    _items
    )
    )

     

     

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 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard