cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bloodoff
Level 8

Merge two single-column tables into one without "each record of the table is added as a separate record"

Hi PA Community,

 

Is there a simple way to merge two tables into one line by line, i.e without "each record of the table is added as a separate record"? (the only thing in common is exactly the same number of rows)

Wish these tables had an internal index which I believe they don't, which people have asked for.

 

What I have:

Table1		Table2
------		------
A		1
B		2
C		3
...		...

What's needed:

Table3
------------------------
Column1		Column2
-------		-------
A		1
B		2
C		3
...		...

Sorry, if it's super simple, sometimes we all overcomplicate things Smiley Happy

 

PS. I do have a workaround for my specific PowerApps Form but that doesn't answer my question.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Merge two single-column tables into one without "each record of the table is added as a separate record"

@bloodoff 

Sure thing...here's a pretty basic formula for that:

 

 

Clear(oneCollection);
ForAll(Table1, 
Collect(oneCollection,
{Column1:Value,
Column2:Last(FirstN(Table2, CountRows(oneCollection)+1)).Value
}
)
)

 

I hope that helps point you in the right direction.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
3 REPLIES 3
Highlighted
Super User
Super User

Re: Merge two single-column tables into one without "each record of the table is added as a separate record"

@bloodoff 

Sure thing...here's a pretty basic formula for that:

 

 

Clear(oneCollection);
ForAll(Table1, 
Collect(oneCollection,
{Column1:Value,
Column2:Last(FirstN(Table2, CountRows(oneCollection)+1)).Value
}
)
)

 

I hope that helps point you in the right direction.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
bloodoff
Level 8

Re: Merge two single-column tables into one without "each record of the table is added as a separate record"

Thanks!

That's a workaround for a missing index column, isn't it? Smiley Happy

Super User
Super User

Re: Merge two single-column tables into one without "each record of the table is added as a separate record"

@bloodoff 

Yes you can.  However, ForAll's are expensive.  So performance can take a hit if overused.

I use this indexing in places where there are small amounts of data to display - like a filtered Gallery.  And usually only to generate an index for even/odd numbering so that I can highlight alternate rows.  It gets tricky sometimes doing that, but...yep...it can be done.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 31 members 4,256 guests
Please welcome our newest community members: