cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

@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
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."

@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

@timl 
I love it!

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

@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 🙂

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.

@timl 

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

Frequent Visitor

Thx! помогло! 

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (4,221)