web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add the manager to the...
Power Apps
Unanswered

Add the manager to the subordinate collection

(0) ShareShare
ReportReport
Posted on by 716 Moderator

So I have populated a collection using:

ClearCollect(
 colTechTeam,
 Office365Users.DirectReportsV2("someone@somewhere.com")
);

The current user's email is stored using this:

Set(
 varCurrentUserEmail,
 User().Email
);

Then I make a filtered collection if the current user is in the list:

ClearCollect(
 colFilteredTechTeam,
 Filter(
 Ungroup(
 colTechTeam,
 value
 ),
 mail = varCurrentUserEmail
 )
);

Visible properties use this:

If(varCurrentUserEmail in colFilteredTechTeam.mail,true)

 

This all works a treat as they say. But, I need to include the manager whose email we used to populate the first collection and I can't figure out how since that collection is inside of a value. And if I try to add them directly to that collection, it actually adds 'columns' to the value table above where the real collection is.

 

It seems like it's probably easier to forego adding them to that first collection since what we really use for visibility is the filtered collection.

 

So my question becomes, how can I modify the second ClearCollect that populates colFilteredTechTeam so that it adds the user if mail = varCurrentUserEmail or "someone@somewhere.com".

 

And I think I just realized how I need to go about it, I just need to get the syntax right.

Which I'd still appreciate help with. 😉

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    on at

    Hi @DCHammer ,

     

    Please try this

    ClearCollect(
     colTechTeam,
     Office365Users.DirectReportsV2("someone@somewhere.com").value,
     Office365Users.UserProfileV2("someone@somewhere.com")
    );
    Set(
     varCurrentUserEmail,
     User().Email
    );
    ClearCollect(
     colFilteredTechTeam,
     Filter(
     
     colTechTeam,
     
     mail = varCurrentUserEmail
     )
    );

     

    Best Regards,

    Wearsky

  • DCHammer Profile Picture
    716 Moderator on at

    Well the code throws no errors. I'll update as soon as the manager tests. And thanks for the lesson. This is reusable knowledge. I have future requirements that will need this type of logic for teams/groups.

  • DCHammer Profile Picture
    716 Moderator on at

    I forgot to come back to update. Worked perfectly. Thank you so much for this. It's something I'll end up using a lot.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard