Hello, is it possible to create a collection based on different tables that are not related?
For example:
Table1 -> Names: "Person1", "Person2", "Person3"
Table2 -> Ages: "Age1", "Age2", "Age3"
And I want my collection to have a column for Table1 (Names) and a column for Table2 (Ages)
Names | Ages
_________________
Person1 | Age1
Person2 | Age2
Person2 | Age3
The tables are not related, I just want to join them based on their position (the first name with the first age, second name with second age...)
Any ideas?
I can't seem to figure it out
Solved! Go to Solution.
@Anonymous
PowerApps does not have the ability to join tables on based on the position. I believe the technical term for your concept is a "Cartesian Join" and the resulting table is called a "Cartesian Product". That's what I remember from learning SQL.
The only way to make your join is to edit the data and assign row numbers like so.
ClearCollect(
NamesTable,
{row: 1, name: "Person1"},
{row: 2, name: "Person2",
{row: 3, name: "Person3"}
);
ClearCollect(
AgesTable,
{row: 1, age: "Age1"},
{row: 2, age: "Age2",
{row: 3, age: "Age3"}
);
Then you would join the columns in another Collection like this
ClearCollect(
myJoinedTables,
ShowColumns(
AddColumns(NamesTable,"Age",LookUp(AgesTable,ID=NamesTable[@ID])),
"Name","Age"
)
---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."
Not really possible without some kind of Field in common to relate one to the next.
@Anonymous
Possible but with lots of work to link the 2 collections
Firstly you will need to ensure you have an index column on both the lists
Check below post on how to create index (look at the last response from MSFT)
Next what you would need to do is the following:
ForAll(CollectionTable, Collect(CollectionJoin,{Tables:CollectionTable[@Tables],Ages: Lookup(CollectionAges, Index = CollectionTable[@Index].Ages}))
where CollectionTable is name of you table colection with Index column
CollectionJoin is name of new collection
CollectionAges is name of collection with Ages and Index column
--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
@Anonymous
PowerApps does not have the ability to join tables on based on the position. I believe the technical term for your concept is a "Cartesian Join" and the resulting table is called a "Cartesian Product". That's what I remember from learning SQL.
The only way to make your join is to edit the data and assign row numbers like so.
ClearCollect(
NamesTable,
{row: 1, name: "Person1"},
{row: 2, name: "Person2",
{row: 3, name: "Person3"}
);
ClearCollect(
AgesTable,
{row: 1, age: "Age1"},
{row: 2, age: "Age2",
{row: 3, age: "Age3"}
);
Then you would join the columns in another Collection like this
ClearCollect(
myJoinedTables,
ShowColumns(
AddColumns(NamesTable,"Age",LookUp(AgesTable,ID=NamesTable[@ID])),
"Name","Age"
)
---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
258 | |
122 | |
85 | |
75 | |
72 |