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

Re: Adding rows from one table to another

@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
Highlighted
Super User III
Super User III

Re: Adding rows from one table to another

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

Highlighted
Super User III
Super User III

Re: Adding rows from one table to another

@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

Highlighted
Super User III
Super User III

Re: Adding rows from one table to another

@timl 
I love it!

Highlighted
Super User III
Super User III

Re: Adding rows from one table to another

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

Highlighted
Super User III
Super User III

Re: Adding rows from one table to another

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

Highlighted
Super User III
Super User III

Re: Adding rows from one table to another

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.

Highlighted
Super User III
Super User III

Re: Adding rows from one table to another

@timl 

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

Highlighted
Frequent Visitor

Re: Adding rows from one table to another

Thx! помогло! 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (7,413)