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:
ID | Name |
1 | Phone |
2 | Speaker |
3 | Headset |
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.
Hi @Anonymous you need to look into the AddColumn funtion along with the Lookup function to bring your one side table into you many table.
------------------------------------------------------------------------------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.
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..
Hi @Anonymous ,
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
User | Count |
---|---|
183 | |
124 | |
88 | |
45 | |
43 |
User | Count |
---|---|
247 | |
156 | |
127 | |
78 | |
73 |