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

Getting records created by a Direct Report

Hello, 

I am looking to get help on how to show records in a gallery that were created from a Direct Report. Right now, I have the formula built out where gallery is showing records that were created by the user, or were created by the manager. but when I try to add Or Office365Users.DirectReportsV2(_myProfile.mail).value, it doesn't work. Any ideas on how to do this?

 

Search(
    Filter(
        'RAIL List',
        'Created By'.Email = _myProfile.mail Or 'Created By'.Email = Office365Users.ManagerV2(_myProfile.mail).mail,
        Progress.Value = "WIP"
    ),
    SearchBox.Text,
    "Title",
    "Customer"
)

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @imadorkous ,

 

Office365Users.DirectReportsV2 function return a table contains all direct report members.

If there is only one direct report or you just want to show the specific one, please try this:

Search(
    Filter(
        'RAIL List',
        'Created By'.Email = _myProfile.mail Or 'Created By'.Email = Office365Users.ManagerV2(_myProfile.mail).mail Or 'Created By'.Email = First(Office365Users.DirectReportsV2(_myProfile.mail).value).mail,
        Progress.Value = "WIP"
    ),
    SearchBox.Text,
    "Title",
    "Customer"
)

If you want to show all direct report, please try this:

Search(
    Filter(
        'RAIL List',
        'Created By'.Email = _myProfile.mail Or 'Created By'.Email = Office365Users.ManagerV2(_myProfile.mail).mail Or 'Created By'.Email in Office365Users.DirectReportsV2(_myProfile.mail).value.mail,
        Progress.Value = "WIP"
    ),
    SearchBox.Text,
    "Title",
    "Customer"
)

Hope this helps.

Sik

View solution in original post

4 REPLIES 4
Super User III
Super User III

Check this post which deals with it:
https://powerusers.microsoft.com/t5/Building-Power-Apps/Display-a-User-s-Direct-Reports-Using-an-Ema...

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Community Support
Community Support

Hi @imadorkous ,

 

Office365Users.DirectReportsV2 function return a table contains all direct report members.

If there is only one direct report or you just want to show the specific one, please try this:

Search(
    Filter(
        'RAIL List',
        'Created By'.Email = _myProfile.mail Or 'Created By'.Email = Office365Users.ManagerV2(_myProfile.mail).mail Or 'Created By'.Email = First(Office365Users.DirectReportsV2(_myProfile.mail).value).mail,
        Progress.Value = "WIP"
    ),
    SearchBox.Text,
    "Title",
    "Customer"
)

If you want to show all direct report, please try this:

Search(
    Filter(
        'RAIL List',
        'Created By'.Email = _myProfile.mail Or 'Created By'.Email = Office365Users.ManagerV2(_myProfile.mail).mail Or 'Created By'.Email in Office365Users.DirectReportsV2(_myProfile.mail).value.mail,
        Progress.Value = "WIP"
    ),
    SearchBox.Text,
    "Title",
    "Customer"
)

Hope this helps.

Sik

View solution in original post

Yup, i was looking for when there are multiple direct reports, it returns all of them; so the bottom formula works. Thank you!

Hi @v-siky-msft

I just learned about delegation warnings today, and I dont want to run into this issue, so I am taking off the search function, but looks like the IN operator would still cause some heartburn. Would there be a way around this? 

'Created By'.Email in Office365Users.DirectReportsV2(_myProfile.mail).value.mail

 

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

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

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (36,222)