cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerUser19
Helper III
Helper III

Filtering the list of managers in a department in People Picker

Hello there,

Is there a way to filter only the list of Managers of a specific department in People Picker? I have a People picker field which lists all the users of our organisation. I would like this people picker to show only the managers of a specific department when the user search. Any help on this is really appreciated.

Thanks!

 

7 REPLIES 7
v-qiaqi-msft
Community Support
Community Support

Hi @PowerUser19 ,

Could you please tell me that how you configure the specific department?

 

Here is a simple demo for you.

1). Create a dropdown to get all the departments,Dropdown1 Items:

Filter(Distinct(ForAll(Office365Users.SearchUserV2().value,ThisRecord.Department),Value),!IsBlank(Result))

2). Get all users in a certain department, Dropdown2 Items:

Filter(Office365Users.SearchUserV2().value,Department=Dropdown1.Selected.Result)

3). Get manager of the specific department,TextInput1 Default:

Office365Users.ManagerV2(Dropdown2.Selected.Id).displayName

 

Best Regards,
Qi
PowerUser19
Helper III
Helper III

Hi @v-qiaqi-msft ,

 

Thanks so much for your response. I would like to get the list of managers of a specific department (which is constant). So I will need to bring the name of the department somewhere in the filter to list the managers of that constant department. The name of the department is not selected from any other field. 

 

I stored the name of the department in a label and tried using that in the 3rd option you provided

Office365Users.ManagerV2(Label38.Text).displayName

It gives me "Expected Table Value" error. Not sure what I am missing here. Attaching the image for your reference.

 

List of managers who are in "Department X"

Hi @PowerUser19,

Just remove the parameter displayName as below:

Office365Users.ManagerV2(Label38.Text)

Then select the displayName from the field:

vqiaqimsft_0-1664173091004.png

 

Best Regards,
Qi

Hi @v-qiaqi-msft ,

Please excuse my ignorance here. I do not see "value" option in my people picker field. I see only "fields" option.  I couldn't select "Display Name" in there.

PowerUser19_0-1664179188374.png

 

Hi @PowerUser19,

vqiaqimsft_0-1664180562421.png

 

Best Regards,
Qi

Hi @v-qiaqi-msft ,

 

Thank you. Sorry again. I get the below error

{"sessionId":"701a1c6d-87e7-4bb2-a490-29f3ba2df444","blobUri":"https://docserverpwaprodeau.blob.core.windows.net/c8c589c3-89f8-4478-a6ba-7f3f5b361f81-1/copyResult/..."}

 

PowerUser19_0-1664189214434.png

 

Hi @PowerUser19

This is an issue related to your API request, just try to remove the connector and re-connect.

Could you please try to troubleshoot it by yourself if there is an issue unrelated to the one you mentioned?

 

If the Combo Box is not necessary, I would suggest you use a Dropdown instead, which I have provided the complete solution in my first reply.

 

 

Best Regards,
Qi

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,566)