cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nours74
Level: Powered On

Help Office365User filtering

Hi everybody !

 

I'm building an advanced app that will change the way my company will process the employee year appraisal form.

My app is based on sharepoint list with a PDF export at the end.

 

My point here is I want to build the app from the connected user.

I mean that the manager will launch the app and he will be able to have a list of all his employees. The datas are based on the office365 users properties where the manager is mentioned.

 

So on my screen I have :

- A Label1 that shows the current user : Office365Users.MyProfile().DisplayName

- A Gallery1 that lists all users : Office365Users.SearchUser({searchTerm:""}) (with display name, jobtitle and photo).

 

I want to filter this gallery to show only uses who the manager is the current user mentionned in the first Label1.

 

I dont know how to do this because as I know its only possible to display the manager of someone but not the reverse.

So I think there's a trick to do this but I dont find how.

 

I was thinking about creating a table that will list all users with a column that will display the manager, this table will be hidden, and then I would use the gallery and display the filtered table.

 

Any idea ?

 

Thanks 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Help Office365User filtering

Hi @Nours74 

 

Can you try to update the expression to:

Filter(Office365Users.SearchUser({Top:500});Office365Users.ManagerV2(Id).mail=Office365Users.MyProfile().Mail)

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

5 REPLIES 5
Microsoft v-siky-msft
Microsoft

Re: Help Office365User filtering

@Nours74 

 

Please try this:

Filter(Office365Users.SearchUser(),Office365Users.ManagerV2(Id).mail=User().Email)

it will filter out all users whose manager is the current user.

Note: if some of the users are not assigned Manager, the formulas will have an error, but it doesn't matter.

Snipaste_2020-01-17_13-59-32.png

Sik

Nours74
Level: Powered On

Re: Help Office365User filtering

Hi, thank you for the reply.

 

I tryed but it didnt worked, I have a test user where I have set me as manager, but theres nothing in the list.

I think its related to the gallery, I dont know why the gallery is not showing the entire list of users, I have about 400 users but the gallery only show about 50 users, is there any limit ?

 

Nours74
Level: Powered On

Re: Help Office365User filtering

I succeeded with this: Filter(Office365Users.SearchUser();Office365Users.ManagerV2(Id).mail=Office365Users.MyProfile().Mail)

I tryed with one of the first 50 users that was shown in the gallery, but I still cannot see the other test user which is not listed by default in the gallery, I'm sure a limitation is preventing me to browse all my 400 users.

 

I tryed with a dropdown list, same result, only one user.

I could maybe try a collection.

Dual Super User
Dual Super User

Re: Help Office365User filtering

Hi @Nours74 

 

Can you try to update the expression to:

Filter(Office365Users.SearchUser({Top:500});Office365Users.ManagerV2(Id).mail=Office365Users.MyProfile().Mail)

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Nours74
Level: Powered On

Re: Help Office365User filtering

Perfect ! thank you for help 🙂

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (6,973)