cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ericonline
Community Champion
Community Champion

Search By JobTitle

Hello,

Does anyone have a solution for searching by JobTitle using either Sharepoint Person-type column or Office365Users connector?

Goal:

- Enter JobTitle keyword

- Return list of employees with keyword in JobTitle

Thanks!

21 REPLIES 21
BenFetters
Continued Contributor
Continued Contributor

Basically what he seems to be doing in the video though is he adds an input text control, and then sets the items property to Office365User.SearchUser({searchTerm: TextInput1.Text, top: 999})

 

Then he turns the IsSearchable property on the combo box to false. He'll walk you through it better than I can explain it but essentially that's what he does to solve the problem. You would just need to filter that formula down a little as you've done before and I think it should work! 

 

Let me know if you have any questions! 

If this solved the problem for you, feel free to hit "Accept as Solution" so others can find the answer easier. 🙂

Kind regards,

Ben Fetters
Power Apps/Power Automate Developer
www.sovereignsp.com

Hi @BenFetters. Thank you for putting more thought into this, but I need a solution for more than 999 records. Our AD is larger than that.

Seems like (in reading the thread) that you were on one path and then diverted to another.

 

I believe you were on the trail with "appending" collections.

 

I say this because we do this with large SharePoint lists and delegation issues where we will use a StartsWith filter on every letter of the alphabet while appending the collection results. (pretty nasty, but works well - even better with a concurrent statement).

 

HOWEVER, the only problem with the SearchUser method is that it throws a wide "net" on several fields.  And, there is no StartsWith to use to get the ability to build a large collection.

 

Seems like that is still a good answer, but you need a different data source.

Is there any possiblity of using Azure SQL, combined with Flow or perhaps even PowerShell scripts to collect a database of what you need - possibly even on a schedule?

Then you could filter and collect from that pretty easily.

 

Just a thought...very interested to hear how this thread turns out!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

I was trying this in the Items property of the gallery and I receive no errors in the formula. However, nothing shows up in the gallery. Annotation 2019-07-26 120001.png

@mlaurie 

Change your formula to:

Filter(Office365Users.SearchUser({searchTerm:""}), "VP" in JobTitle)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Thank you for the super fast reply. Still no luck with the suggest formula. Are there any other properties needing to be changed for the gallery?

 

Annotation 2019-07-26 123331.png

@mlaurie 

No, the formula is all fine and the gallery field seem to be correct.

I would check that you actually have users with "VP" in the job title.

To do so, perhaps change your formula to Office365Users.SearchUser({searchTerm:""}) and then look through the results in your Gallery (you *should* see results with that formula).

If you have a large number of users, you might also want to use the top: value in your SearchUser function as well to return more results.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

With your troubleshooting step, I think I figured out what is going on. We have thousands of AD objects and in the top;100 no one with "VP" in the title populated. When I changed it to top:500 I had one show up. Now it's just a matter of being able to search all objects. Any tips?

@mlaurie 

This is a challenge with large numbers of users.  The SearchUser function will only search 500

Since your Filter is "around" the results of the SearchUser function, you will only be able filter over a max of 500.  There is no way to narrow that down as SearchUser only searches certain properties.

The only real way to do this in PowerApps (specifically) is to create a local collection and collect all of the users locally.  Then you can filter over that.

It's tricky with the Users connector because there is no real way to apply traditional record gathering from the user list.  The only real search/wildcard function IS the SearchUser function.  

 

EDIT: actually I believe 999 is the most you can search, not 500. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Thank you. I was worried this was the case. I think Flow may be able to help me in this situation.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (75,121)