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

Add column to single column table in ForAll loop

Hi everyone,

I am having a collection that can have multiple records in it. A collection has the following columns. 

colProducts.png

 

 

 

 

 

Products: Concatenated values from record columns.

RecordId: Generated unique identifier.

 

 

Clear(colProducts);
ForAll(
    Gallery2_1.AllItems,
    Collect(
        colProducts,
        {
            RecordId: RecordId,
            Products: Concatenate(
                If(
                    ThisItem.Sharepoint = "true",
                    "Sharepoint",
                    "false"
                ),
                ",",
                If(
                    ThisItem.Dynamics = "true",
                    "Dynamics",
                    "false"
                ),
                ",",
                If(
                    ThisItem.Office = "true",
                    "Office",
                    "false"
                ),
                ",",
                If(
                    ThisItem.PowerApp = "true",
                    "PowerApp",
                    "false"
                ),
                ",",
                If(
                    ThisItem.PowerBI = "true",
                    "PowerBI",
                    "false"
                ),
                ",",
                If(
                    ThisItem.Flow = "true",
                    "Flow",
                    "false"
                )
            )
        }
    ));

 

Next, I create a collection based on "Products" column so that each product is actually a new record. I am achieving this by using Split function. 

 

ForAll(colProducts, Collect(colProductsRecords, Split(Products, ",")))

 

BUT, I also want to add new column to collection "colProductsRecords", RecordId for each product record created, depending on the current iteration item.  Result should be this: 

colProductsRecords.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Thank you all for helping!

HappyShroom

0 REPLIES 0

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

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

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (20,262)