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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Need Help merging two ...
Power Apps
Answered

Need Help merging two collections

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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

Categories:
  • Verified answer
    mdevaney Profile Picture
    29,993 Moderator on at
    @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 Profile Picture
    156,566 Most Valuable Professional on at

    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.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @mdevaney I am getting this error

     

    PowerApps_2.1.2020 (2).PNG

    PowerApps_2.1.2020.PNG
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @mdevaney 

    Thank you!

     

    This Worked

     

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

     

  • mdevaney Profile Picture
    29,993 Moderator on at
    @Becca51178
    You are right. I’ll make that small edit to the solution when I get home in an hour.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard