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

Combining 2 data sets for a Gallery query

Hello
Im joining 2 datasets "colTeam" and "colTeam2" into a collection called "Combined" so i can display info from both in a gallery but its currently joining randomly and i need to match the two sets by email address

E.G - Gallery shows user Test.test.com (colteam) and the 'Title' from colteam2 where Email in colteam2 equals Test.test.com. If the email address isn't found in colteam2 then it displays as blank

Is this possible? This is what ive got -

Thanks

 

Concurrent(
    ClearCollect(
        colTeam,
        Office365Users.DirectReports(User().Email)
    ),
    ClearCollect(
        colTeam2,
        SortByColumns(
            Filter(
                PDRPowerApps_1,
                Not(User().Email in 'Created By'.Email) And Title = txtMyTeamYear.Text And Manager = lblRevieweeName.Text
            ),
            "Title",
            Descending
        )
    );
    ClearCollect(
        counter,
        0
    )
);
Clear(Combined);
ForAll(
    colTeam,
    Collect(
        counter,
        Last(counter).Value + 1
    );
    Collect(
        Combined,
        {
            colTeam: Last(
                FirstN(
                    colTeam,
                    Last(counter).Value
                )
            ).DisplayName,
            colTeam2: Last(
                FirstN(
                    colTeam2,
                    Last(counter).Value
                )
            ).'Form Status'
        }
    )
);

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @StuPower ,

Do you want to merge the "colTeam" and "colTeam2" into a single one collection base on the email address?

 

Based on the formula you provided, I think there is something wrong with it. I have made a test on my side, please consider take a try with the following workaround (set the OnStart property of App to following😞

 

Concurrent(
    ClearCollect(
        colTeam,
        Office365Users.DirectReports(User().Email)
    ),
    ClearCollect(
        colTeam2,
        SortByColumns(
            Filter(
                PDRPowerApps_1,
                Not(User().Email in 'Created By'.Email) And Title = txtMyTeamYear.Text And Manager = lblRevieweeName.Text
            ),
            "Title",
            Descending
        )
    )
);
ClearCollect(
Mergedcollection
AddColumns(
colTeam,
"Title",
LookUp(colTeam2, 'Created By'.Email = Mail).Title,
"FormStatus",
LookUp(colTeam2, 'Created By'.Email = Mail).'Form Status',
...
...
)
)

Then set the Items property of the Gallery to following:

Filter(Mergedcollection, !IsBlank(Title))

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xida-msft
Community Support
Community Support

Hi @StuPower ,

Do you want to merge the "colTeam" and "colTeam2" into a single one collection base on the email address?

 

Based on the formula you provided, I think there is something wrong with it. I have made a test on my side, please consider take a try with the following workaround (set the OnStart property of App to following😞

 

Concurrent(
    ClearCollect(
        colTeam,
        Office365Users.DirectReports(User().Email)
    ),
    ClearCollect(
        colTeam2,
        SortByColumns(
            Filter(
                PDRPowerApps_1,
                Not(User().Email in 'Created By'.Email) And Title = txtMyTeamYear.Text And Manager = lblRevieweeName.Text
            ),
            "Title",
            Descending
        )
    )
);
ClearCollect(
Mergedcollection
AddColumns(
colTeam,
"Title",
LookUp(colTeam2, 'Created By'.Email = Mail).Title,
"FormStatus",
LookUp(colTeam2, 'Created By'.Email = Mail).'Form Status',
...
...
)
)

Then set the Items property of the Gallery to following:

Filter(Mergedcollection, !IsBlank(Title))

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

@v-xida-msftThanks alot that worked a treat!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

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.

Top Solution Authors
Top Kudoed Authors
Users online (2,505)