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 / Create a gallery of us...
Power Apps
Unanswered

Create a gallery of users with specific job title

(0) ShareShare
ReportReport
Posted on by 4

I am trying to create a gallery of employees with a specific job title.
I've tried to use the following filter for the Items, and my gallery is blank:

 

Filter(Office365Users.SearchUserV2().value, JobTitle = "Technician")

 

I've also tried this with adding "top:9999" and "isSearchTermRequired: false" to the search parameters, and it returns blank.

When I use this filter:

 

Filter(Office365Users.SearchUserV2({searchTerm: "f"}).value, JobTitle = "Technician")

 

The gallery does fill with all technicians with a name starting with "f". 

Any ideas on what's going on here or how to accomplish this?

 

Categories:
I have the same question (0)
  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @MataiLeak 

     

    Try this:

    // create a collection
    ClearCollect(
     colUsers, 
     Office365Users.SearchUserV2({top: 999, isSearchTermRequired:false}).value
    );
    
    // filter the colllection
    Filter(
     colUsers, 
     JobTitle = "Technician"
    )

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • MataiLeak Profile Picture
    4 on at

    Still getting the same issue. The collection is blank unless I pass a searchTerm.

  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    @MataiLeak 

     

    I did a test and I get records in my collection:

    SpongYe_0-1702685087311.png

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

     

     

     

  • MataiLeak Profile Picture
    4 on at

    Ok, it looks like the problem is that searchUser only returns 999 results, and my search pool is around 5000. So the collection fills, but technicians are not in the top 1000 employees. Is there any way around that cap?

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @MataiLeak ,

     

    If you want to collect all users , please try:

    I did a sample for you.

    1\ Add a button control and set its onselect property to:

    Clear(Col);Set(varNextlink,Blank());Set(varNextlinkTemp,Blank());Set(varSkiptoken,"");With(Office365Users.SearchUserV2({searchTerm:"",isSearchTermRequired:false}),Collect(Col,ThisRecord.value);Set(varNextlink,ThisRecord.'@odata.nextLink');Set(varSkiptoken,Mid(varNextlink,Find("skipToken",varNextlink)+10)));Set(varNextlinkTemp,varNextlink)

     

    2\ Add a toggle control and set its Default property to:

    If(varNextlinkTemp=Blank(),true,varNextlinkTemp=varNextlink,false,true)

     

    Set the toggle's OnCheck property to:

    Set(varNextlinkTemp,varNextlink)

     

    Set the toggle's OnUncheck property to:

    If(varNextlink=Blank()&&varNextlinkTemp=Blank(),Blank(),With(Office365Users.SearchUserV2({searchTerm:"",skipToken:varSkiptoken,isSearchTermRequired:false}),Collect(Col,ThisRecord.value);Set(varSkiptoken,Mid(ThisRecord.'@odata.nextLink',Find("skipToken",ThisRecord.'@odata.nextLink')+10));Set(varNextlink,ThisRecord.'@odata.nextLink')))

     

    Set the toggle's visible property to:

    false

     

    Best Regards,

    Bof

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

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard