Hello everyone,
I hope someone can help me with the following scenario. I have the following collection, which stores the subordinates of my manager. So I retrieve them and save them in the collection.
ClearCollect(mySubordinatePersons;
'Office365User'.DirectReportsV2('Office365User'.MyProfileV2().mail).value
);;
I also have a variable that saves my login file.
Set(
vCurrentUser
; First( 'Office365-User'.SearchUser({searchTerm: User().Email})
));;
I have a small app that displays projects in a gallery.
I want that the gallery show only my projects and those of my subordinates. So if you don't have any subordinates, the app should only show my projects.
I would love to see some Hints. You Guys are awesome! Thanks for Help!
Yes excactly. I have to test it with managers :'D
Im not in this position right now.
@Marczii007 Awesome! Does this formula also account for the situation where you do have Subordinates, but also want to see your own projects?
If not, I think the formula that does account for that situation would be something like:
&& Or(
'Einreicher Mail' in mySubordinatePersons.mail,
'Einreicher Mail' = vCurrentUser.UserPrincipalName
)
Best of luck!
thanks, i got it.
in items property of my gallery
&& If(
CountRows(mySubordinatePersons) > 0,
'Einreicher Mail' in mySubordinatePersons.mail,
'Einreicher Mail' = vCurrentUser.UserPrincipalName
)
You'll need a Filter()-statement around your Items of the gallery. This filter should define that you only want projects where ProjectOwner (or however you can see what 'my projects' are) is equal to vCurrentUser or one of the values in mySubordinatePersons. I don't know what the exact names / columns in your app are, but it could be something like:
Filter(ProjectDataSource, Projectowner = vCurrentUser || Projectowner in mySubOrdinatePersons).
|| is the operator in Power Apps to indicate an Or()-statement. This means that either the first or the second filter-statement has to be true for a row to be shown in the gallery.