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!
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!
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!
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.
Change your formula to:
Filter(Office365Users.SearchUser({searchTerm:""}), "VP" in JobTitle)
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?
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.
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?
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.
Thank you. I was worried this was the case. I think Flow may be able to help me in this situation.
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
276 | |
236 | |
83 | |
38 | |
35 |
User | Count |
---|---|
353 | |
242 | |
129 | |
73 | |
51 |