cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Arsnova
Frequent Visitor

Adding rows from one table to another

Good day, help , please. (PowerApps)

I have  

Table 1

Color
Green
Red

 

Table 2

Numer
1
2

 

I need to know how to do this : 

 Color  Numer
 Red 1
Red2
Green1
Green2
1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User III
Super User III

@mdevaney 's solution is correct.

However, I was interested to see if I could do this without ForAll and I came up with this:

Ungroup(AddColumns(Table1, "T2", Table2), Color)

 

image.png

Perhaps this might be of some help to you.

View solution in original post

8 REPLIES 8
mdevaney
Super User III
Super User III

@Arsnova 

Put this code in the OnVisible property of your screen or the OnSelect property of a button.

 

 

ForAll(
    Table1,
    ForAll(
        Table2,
        Collect(
            colCombinedTables
            {Color: Table1[@Color], Number: Table2[@Number]}
        ),
    )
)

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

timl
Super User III
Super User III

@mdevaney 's solution is correct.

However, I was interested to see if I could do this without ForAll and I came up with this:

Ungroup(AddColumns(Table1, "T2", Table2), Color)

 

image.png

Perhaps this might be of some help to you.

View solution in original post

mdevaney
Super User III
Super User III

@timl 
I love it!

timl
Super User III
Super User III

Glad you love it @mdevaney! Feel free to add it to the Cookbook if you think it'll help. 

mdevaney
Super User III
Super User III

@timl 
Good idea Tim!  I've been keeping a list of new recipes to add once I have a significant amount.

What would you propose for a one sentence description?  My only idea is: "cartesean product join" but that's not exactly plain-english 🙂

timl
Super User III
Super User III

That's a tough one. I would have said "cross join", but that probably wouldn't mean very much if you didn't have a database background.

mdevaney
Super User III
Super User III

@timl 

"Cross join" is still much better than "Cartesian Product" in my humble opinion.  Great suggestion Tim.  I'll bookmark this!

Arsnova
Frequent Visitor

Thx! помогло! 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (14,594)