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

Need Help merging two collections

I have one list of events people can sign up for, and another list of the total people who have signed up for an event. 

 

The first collection works. It sums the total signers for an event. 

ClearCollect(TotalSignees, AddColumns(GroupBy(SignUpList, "EventName", "TotalSignees"), "NumOfSignUps", Sum(TotalSignees, EventName = EventName)));

 

The second collection does not work. It's adding a number to every item on the list regardless of the event

ClearCollect(ProjectSignUpListWithVolunteerCount, AddColumns(ProjectsEventsList_SPList, "NumOfSignUps", LookUp(TotalSignees, EventName=EventName, NumOfSignUps)));

 

All I want to do is merge the collections and if there is match insert that number into the column and if there there are no matches add a zero

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@Becca51178
Would adding some disambiguation to EventName like I’ve done below do the trick?

ClearCollect(ProjectSignUpListWithVolunteerCount, AddColumns(ProjectsEventsList_SPList, "NumOfSignUps", LookUp(TotalSignees, EventName=EventName[@ ProjectsEventsList_SPList], NumOfSignUps)));

—-
Please Accept as Solution if this post answered your question so others may find it more quickly.
If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

5 REPLIES 5
mdevaney
Super User
Super User

@Becca51178
Would adding some disambiguation to EventName like I’ve done below do the trick?

ClearCollect(ProjectSignUpListWithVolunteerCount, AddColumns(ProjectsEventsList_SPList, "NumOfSignUps", LookUp(TotalSignees, EventName=EventName[@ ProjectsEventsList_SPList], NumOfSignUps)));

—-
Please Accept as Solution if this post answered your question so others may find it more quickly.
If you found this post helpful consider giving it a Thumbs Up.
WarrenBelz
Super User
Super User

Hi @Becca51178 ,

 

You can merge two collections with the same field names by collecting them separately and then doing ClearCollect(Collection1,Collection2).

You can use RenameColumns and AddColumns to achieve this result. 
Here is a post to read on it. 

Please click and accept as Solution if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

@mdevaney I am getting this error

 

PowerApps_2.1.2020 (2).PNG

@mdevaney 

Thank you!

 

This Worked

 

ClearCollect(ProjectSignUpListWithVolunteerCount, AddColumns(ProjectsEventsList_SPList, "NumOfSignUps", LookUp(TotalSignees, EventName = ProjectsEventsList_SPList[@EventName], NumOfSignUps)));

 

@Becca51178
You are right. I’ll make that small edit to the solution when I get home in an hour.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,475)