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

Org Chart from local collection (without Office365 connector!)

Hi everyone,

 I'm struggling with collecting direct and indirect reports without using the Office 365 connector (I have a solution with it in place but the performance is bad when collecting multiple levels). 

 

I do have a master collection (MergedPDC) with all employees (column name: 'Employee Name')  and their supervisor (column name: 'Supervisor Name') and their email address (column name: 'Email') . I want to collect all indirect reports of the current user of the app to show up in a gallery.

 

1.) Collect direct reports of the current user (testemail) -> working fine

 

ClearCollect(
DirectReports,
Filter(MergedPDC,'Supervisor Name'=LookUp(MergedPDC,Email=testemail).'Employee Name')

 

2.) collect all direct report of every direct report of step 1 -> here I'm struggling 

 

ForAll(
DirectReports,
Collect(
InDirectReports,
Filter(MergedPDC,'Supervisor Name'....

 

I want to filter all employees in the master collection with ,'Supervisor Name' = directreports.'Employee Name'

 

I am grateful for any advice!

 

1 ACCEPTED SOLUTION

Accepted Solutions

I found a solution utilizing a gallery but no idea about directly working on collection level.

 

Clear(InDirectReports);
ForAll(
    Gallery1.AllItems,
    Collect(
        InDirectReports,
        Filter(
            MergedPDC,
            'Supervisor Name' = Title1.Text
        )
    )
)

View solution in original post

3 REPLIES 3
Eelman
Super User
Super User

@Christoph15 what have you tried?

 

Have you tried

ForAll(
    DirectReports,
       Collect(InDirectReports,
          Filter(MergedPDC,'Supervisor Name' = 'Employee Name')
       )
)

 

 

yep and doesn't work -> I think as the logical test only compares the columns inside MergedPDC and not in relation to the DirectReports collection.

 

to test:

 

First(Filter(MergedPDC,'Supervisor Name' = 'Employee Name')).'Employee Name'   

 

is empty

I found a solution utilizing a gallery but no idea about directly working on collection level.

 

Clear(InDirectReports);
ForAll(
    Gallery1.AllItems,
    Collect(
        InDirectReports,
        Filter(
            MergedPDC,
            'Supervisor Name' = Title1.Text
        )
    )
)

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,275)