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

Notifications

Announcements

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

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:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,989 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
    153,084 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
    on at

    @mdevaney I am getting this error

     

    PowerApps_2.1.2020 (2).PNG

  • Community Power Platform Member Profile Picture
    on at

    @mdevaney 

    Thank you!

     

    This Worked

     

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

     

  • mdevaney Profile Picture
    29,989 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard