cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
asifkhawaja
Advocate IV
Advocate IV

Merging two tables or collections into one

I am stuck with a very basic problem. I have two collections

Collection1

Name

------

name1

name1

 

Collection2

Email

------

email1

email2

 

I want to merge these two into one collection as following:

Collection3

Name      Email

-------------------

name 1    email1

name2     email2

 

Any ideas? Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
CNT
Super User
Super User

@asifkhawaja Try this,

ClearCollect(colName, {Name:"Tom"}, {Name:"Mark"}, {Name:"John"});
ClearCollect(colEmail, {Email:"emailTom"}, {Email:"emailMark"}, {Email:"emailJohn"});
ClearCollect(colCombinedNameEmail, ForAll(Sequence(CountRows(colName)), ({Name:First(LastN(colName,ThisRecord.Value)).Name, Email:First(LastN(colEmail,ThisRecord.Value)).Email})))

View solution in original post

3 REPLIES 3
CNT
Super User
Super User

@asifkhawaja Try this,

ClearCollect(colName, {Name:"Tom"}, {Name:"Mark"}, {Name:"John"});
ClearCollect(colEmail, {Email:"emailTom"}, {Email:"emailMark"}, {Email:"emailJohn"});
ClearCollect(colCombinedNameEmail, ForAll(Sequence(CountRows(colName)), ({Name:First(LastN(colName,ThisRecord.Value)).Name, Email:First(LastN(colEmail,ThisRecord.Value)).Email})))

Of course, of course! Thank you so much. You made my day!

@asifkhawaja Glad to help!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,973)