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 / Profile+ App and Offic...
Power Apps
Unanswered

Profile+ App and Office365Users.SearchUser

(0) ShareShare
ReportReport
Posted on by 196

Hi,

I'm currently tweaking the Profile+ app and I want to add the ability for users to search by job titles. I can see that the search app currently uses : 

 

 

If(
 !IsBlank(txtFindPeople.Text),
 Office365Users.SearchUser({searchTerm: txtFindPeople.Text})
)

 

 

Is there a way to modify this so that it also looks up the job title ? i can see the info is returned in the gallery so there must be a way to search this as well, i don't want to create a drop down or a picker for job titles as this just isn't user friendly. 

Categories:
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @mousman85 ,

     

    You can change the formula to:

    
    If(
     !IsBlank(txtFindPeople.Text),
     With({wUsers:Office365Users.SearchUserV2({searchTerm:txtFindPeople.Text}).value},Filter(wUsers, StartsWith(JobTitle,txtFindPeople.Text)))
    )

     

    Best regards,

  • mousman85 Profile Picture
    196 on at

    Hi @v-jefferni 

    I've swapped out the code but the search returns no results, even just searching name, and searching job titles i know exist nothing is returned, any ideas why? I'm not seeing any errors either?

     

    Might not have been clear in my initial post, that i want the user to be able to search by Name AND Job title. 

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @mousman85 ,

     

    How many users are there? If more than 999, Office 365 users connector will not be able to retrieve all uses. Please see in below video to get a workaround:

    https://www.youtube.com/watch?v=QhGV4AhCFRc

     

    Best regards,

  • mousman85 Profile Picture
    196 on at

    Hi,

     

    I ended up completely customising the search function as the office365users connection doesn't allow searching by department or jobtitle. I changed the gallery to this:

     

     

    If(
     !IsBlank(txtFindPeople.Text),
     Search(GroupUsers, txtFindPeople.Text,"Department","displayName","jobTitle","userPrincipalName"
     )
    )

     

     

    And created a new collection called GroupUsers which collects all the members that are in the our company only 365 group and then adds columns to that collection looking up each member by ID. I only needed to add the department to this collection as the Office365Groups connection brings in the job title field. 

     

    clearCollect(GroupUsers, AddColumns(Office365Groups.ListGroupMembers("2236fed9-2b9c-429d-a509-0acf0ceff5b7", {'$top':999}).value, "Department",Office365Users.UserProfile(id).Department));

     

     

    We only have 500 employees so this works for us, as stated if you have over 999 you'd need to use the workaround from Shane , which I believe is loading the maximum return results into Collection A, then finding the next set of results that aren't in Collection A, and added them to Collection B, and so on until all users are collected and then adding all collections together into a final master collection that you can then use the search/filter functions on. 

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
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard