cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tamras
Level 10

Direct Reports - collection within a collection

Is there a way I could create a collection within a collection?  For example:

 

ClearCollect(
    myReports,
    Filter(
        Office365Users.DirectReports(_varMyEmail),
        AccountEnabled = true
    )
);

 

 It should give me all email directly reporting to me.  But if my manager is viewing the app, she should see everyone directly reporting to her including staff directly reporting to each of her staff. 

So if my staff Employee 1 & 2 are both managers with 5 staff each.  When I view the app, the gallery should display Employee 1 & 2 + 10 staff.

5 REPLIES 5
dynamicsedge
Level 8

Re: Direct Reports - collection within a collection

@Tamras 

 

Try this high level approach

 

Use AddColumns to merge two collections. Similar discussion: Merge one collection with another 

 

The generic approach above could work if adapted to your case.

Highlighted
Tamras
Level 10

Re: Direct Reports - collection within a collection

@dynamicsedge Thanks. I'll test this soon. I'm currently testing another solution from another post. But I will definitely post back the results later.  

Dual Super User
Dual Super User

Re: Direct Reports - collection within a collection

Hi @Tamras 

 

You can follow these threads to get a list of all the direct and indirect staff members for a specific user:
 
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!
dynamicsedge
Level 8

Re: Direct Reports - collection within a collection

@Tamras 

 

You can also try something like this (from Direct Reports and Indirect/ Subordinates in powerapps 😞

 

From one button:

ClearCollect(
DirectReports,
Office365Users.DirectReports("YourManagerEmail")
)

 

Set the OnSelect proeprty of the "InDirect Reports" button to following:

Clear(InDirectReports);
ForAll(
DirectReports,
Collect(InDirectReports, Office365Users.DirectReports(Mail))
)

 

Dual Super User
Dual Super User

Re: Direct Reports - collection within a collection

@Tamras 

 

If you would go to the links provided in my response, you will be able to understand the whole process of what is going on in this case. A well explained solution is provided on the thread.
 
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!

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,397)