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

Create datatable from multiple other datatables

Hi, 

I have in total 3 different datatables. 

All datatables hold different columns and I would like to combine different columns that I need in a new datatable. 

The linkage between the different datatables is made by a recid field that I can identify. 

Is it possible to select for example column 1 from datatableA, column 5 from datatableB and column 9 from datatableC and add those three columns into a new datatable?

Best regards, 

Ludwig

3 REPLIES 3
Community Support Team
Community Support Team

Re: Create datatable from multiple other datatables

Hi @lreinhard7 ,

Could you tell me what data type are the columns that you want to combine with together?

I assume that they are text.

You could try this formula:

ClearCollect(test,
ShowColumns( AddColumns( table1, "column2", LookUp(table2, ID = fruit[@ID], columnname2),
"column3",
LookUp(table3,ID=fruit[@ID],columnname3)), "ID", "columnname1","column2","column3")
)

Here's a similar issue for your reference:

https://powerusers.microsoft.com/t5/General-Discussion/Syntax-for-joining-tables/td-p/61387

 

 

Best regards,

Community Support Team _ Phoebe Liu

 

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lreinhard7
Level 8

Re: Create datatable from multiple other datatables

Hi,

I tried a 'baby step' first but already failed with this one.

Here is my example:

I have a datatable - GeneralLedgerActivities - for which I add all fields to a collection (Coll2) - see first and second screenprint

Then I have a second datatable - Main Accounts - where I filter a single account only. I would like to show this account in each row of the the collection coll2 by pressing the button that adds a column.

Unfortunately, this does not work and I receive a delegation warning instead that this might not work in large datasets.

I also tried using the [@MainAccountRecId] in the formula but this did also not work.

Do you have a tip for me?

Best regards,

Ludwig

 

 

 

 

 

 

 

 

Community Support Team
Community Support Team

Re: Create datatable from multiple other datatables

Hi @lreinhard7 ,

I suggest you try this formula:

AddColumns(coll2,"AAA",LookUp(Mainaccounts,MainAccountRecId in coll2.MainAccountRecId,MainAccount))

 

Mainaccounts.MainAccountRecId and coll2.MainAccountRecId are two tables, they can't be used to compare.

 

As the problem of delegation, try to use delegatable functions.

If your records are smaller than 2000, then you could ignore the warning.

Here's a doc about delegation for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

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

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 47 members 4,947 guests
Please welcome our newest community members: