cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nass
New Member

Table in collection

Hello

 

i have a collection like this :

 

Collection {

    Column_1:"data1",

    Column_2:"data2",

    Coumn_3: table { 

                                 Column_:"data3" 

                    }

}

and i want to convert this collection into :

 

Collection {

 

  Column_1:"data1",

  Column_2:"data2",

  Column_3:"data3"

}

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @mdevaney ,

Do you want to transfer table1 to table2?

Table1:

Column_1, Column_2, Column_3(Column_)

Table2:

Column_1, Column_2, Column_3

 

If so, if you only use Ungroup() function, you will get table like this:
Column_1, Column_2, Column_

The nested field name will replace Column_3 field name.

So you also need to use RenameColumns() function.

 

Try this formula:

ClearCollect(new_collection, 
             RenameColumns(
                            Ungroup(your_collection_name, "Column_3"),
                            "Column_","Column_3"
                           )
             )

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
mdevaney
Super User
Super User

@Nass 

You can UNGROUP the collection like this

ClearCollect(new_collection, Ungroup(your_collection_name, "Column3"))

 

 

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

Hi @mdevaney ,

Do you want to transfer table1 to table2?

Table1:

Column_1, Column_2, Column_3(Column_)

Table2:

Column_1, Column_2, Column_3

 

If so, if you only use Ungroup() function, you will get table like this:
Column_1, Column_2, Column_

The nested field name will replace Column_3 field name.

So you also need to use RenameColumns() function.

 

Try this formula:

ClearCollect(new_collection, 
             RenameColumns(
                            Ungroup(your_collection_name, "Column_3"),
                            "Column_","Column_3"
                           )
             )

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank it works !

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,947)