cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Andrew_Song1999
Level: Powered On

Need help joining tables in powerapps.

Hello,

 

I am trying to join data I have from 3 separate sharepoint lists to populate a datatable in powerapps.

 

The main issue is that I need records from one table to become columns in the datatable. 

 

Table: 

IDName
1Phone
2Speaker
3Headset

 

I need the Names of the table to become columns in my datatable. The tables are linked via ID keys, so performing lookup operations shouldnt be an issue; the issue is that I am struggling figuring out the syntax for essentially "looping" over this table and joining it such that these Names become columns in the datatable.

 

Any help appreciated.

3 REPLIES 3
datamaster
Level 8

Re: Need help joining tables in powerapps.

Hi @Andrew_Song1999  you need to look into the AddColumn funtion along with the Lookup function to bring your one side table into you many table.

ClearCollect(
colJoinTable,
AddColumns(
colDetails,
"Name",
LookUp(
colHeader,
ID = HeaderID
).Name
)
)

 

------------------------------------------------------------------------------OfficePowerUser.com------------------------------------------------------------------------ 
If this post helps answer your question, please click on “Accept as Solution” to help other members. If you thought this post was helpful, please give it a Thumbs Up. 

Andrew_Song1999
Level: Powered On

Re: Need help joining tables in powerapps.

Thanks for the reply. Unfortunately that solution doesn't help in my case because if I wanted to add columns based on records, I can't simply hardcode a column name as the second parameter in the AddColumns function. I would need a way to essentially loop through a specified range of records, grab the item name, and use those as the column name in the Add Columns function. I'm starting to think this isn't possible..

v-siky-msft
Level 10

Re: Need help joining tables in powerapps.

Hi @Andrew_Song1999 ,

 

Could you share more detail thoughts with your scenario?

What is the relationship between these table? Can you describe more clearly?

What is data source? What is the data type of columns?

 

From my experience, Do you want to join two tables by the ID column? You can use ForAll function:

AddColumns(TableB,"Name",""); ForAll(TableA, Patch(TableB, LookUp(TableB, ID = TableA[@ID]),{Name:TableA[@Name] }))

The above code is creating the Name column in TableB, and Patch All TableA's name ( ID is matched) to TableB‘s Name column.

It's just for reference, you can post more details, and I will provide the code that fit your App.

Best regards,

Sik

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,163)