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 / Listing users based on...
Power Apps
Answered

Listing users based on First Name

(0) ShareShare
ReportReport
Posted on by 8

Hello, I am working on an employee directory power app and my gallery only shows about 100 items max. I was wondering if I can fix this by displaying employees that have first names that start with A-F on one page, G-M on one page and  N-Z on one page. So when a user clicks G-M the page updates to show records of employees with a first name between G-M. I attached an image to show what I am thinking about. If this is possible, how would I go about implementing it?

IMG-0472.JPG
Categories:
I have the same question (0)
  • Verified answer
    v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi @karane,

     

     

    If you prefer to use button to filter the Gallery, then please follow the steps below:

    1. Add three button, change the Text Property of the Button to:

    "A-F", "G-M", "N-Z"

    2. Under the OnSelect property of button A-F, enter the formula below:

    Set(Var1,["A","B","C","D","E","F"])

    G-M button OnSelect property:

    Set(Var1,["G","H","I","J","K","L","M"])

    N-Z OnSelect property:

    Set(Var1,["N","O","P","Q","R","S","T","U","V","W","X","Y","Z"])

    3. Under the item property of the gallery, enter the following:

    If(!IsEmpty(Var1),Filter(Employee,Left(FirstName,1) in Var1.Value),Employee)

    4. Under the OnVisible property of the Screen (this is used to Reset the filter):

    Set(Var1,[])

    Reference:

    Filter.gif

     

    Regards,

    Michael

  • karane Profile Picture
    8 on at

    Hi @v-micsh-msft

    But I am using the following under the items part of gallery: 

    Sort(Filter(Office365Users.SearchUser(), Len(GivenName) > 0, IsMatch(Mail, "@laner.org", Contains & IgnoreCase), !IsBlank(Department), !IsBlank(JobTitle)), GivenName, Ascending)

    How would I incorporate your code while still pulling information from office 365?

    Also, when I used your items property of gallery on a different screen I get the error: The function "Left" has some invalid arguments.

     

    Also, under the OnVisible property of screen I have:

    UpdateContext({searchReset:true});
    UpdateContext({searchReset:false});
    ClearCollect(myProfile, {profile : Office365Users.MyProfile()})

    Would I just add the onvisible code you gave to the end?

    Thank you!

  • Verified answer
    v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi @karane,

     

    Yes, just add the code behind the existing one under the OnVisible property.

     

    For the filter with Officec 365 use, switch the formula as below:

    Sort(
    Filter(Office365Users.SearchUser(),
    Len(GivenName) > 0,
    IsMatch(Mail, "@laner.org",
    Contains & IgnoreCase),
    !IsBlank(Department), !IsBlank(JobTitle),
    Left(DisplayName, 1) in Var1.Value),
    GivenName,
    Ascending)

    Regards,

    Michael

  • karane Profile Picture
    8 on at

    Thanks @v-micsh-msft,

     

    It seems that office 365 connector is only pulling information up to initial "D". Before I used Office365Users.SearchUser() in the gallery property and it should have listed all the records but it only went till "D". Your buttons do work but I guess powerapps is only pulling information up to initial "D". Thanks!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard