web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Create a Collection fr...
Power Apps
Answered

Create a Collection from multiple Split() functions with column Id/row number

(1) ShareShare
ReportReport
Posted on by 107
I have two columns in an SP list that I need to use the Split() function with a comma separator to get the individual items.
 
Ex.
Column1 Column2
test1,test2,test3 atest1,atest2,atest3
 
ForAll(Split(currItem.Column1, ","), Value)
ForAll(Split(currItem.Column2, ","), Value)
 
I could create individual collections for each column (2 collections for the columns and 1 collection for the row using Sequence()), but is there a way to combine these three collections or just do it in one clearcollect function?
 
Expected output of my collection should be like this:
 
Collection
row name1 name2
1 test1 atest1
2 test2 atest2
3 test3 atest3
 
Any help is appreciated.
Categories:
I have the same question (0)
  • Suggested answer
    Daniel Bocklandt Profile Picture
    5,099 Super User 2025 Season 2 on at
    Hey ,
     
    I've found a way to do what you need. 
    Try this: 
    Clear(colEnd);
    With(
        {
            Column1Data: Split(
                First(colStart).Column1,
                ","
            ),
            Column2Data: Split(
                First(colStart).Column2,
                ","
            )
        },
        With(
            {RowCount: CountRows(Column1Data)},
            ForAll(
                Sequence(RowCount) As Number,
                Collect(
                    colEnd,
                    {
                        row: Number.Value,
                        name1: Index(
                            Column1Data,
                            Number.Value
                        ).Value,
                        name2: Index(
                            Column2Data,
                            Number.Value
                        ).Value
                    }
                )
            )
        )
    )
    colStart is your first Table and colEnd is the Result:
     
     

     
    If this Solved your question consider accepting it as a solution so others can find it as well. 
    If it helped in any other way consider giving it a Like so we can keep supporting each other. 
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard