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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / split values into a table
Power Apps
Answered

split values into a table

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

My problem:

3 text fields

 

text 1:

apple,orange,banana

text 2:

tomato,celery,broccoli

text 3:

milk,heavy cream,half and half

text 4:

miguel's list, bob's list, jim's list

 

 

then separate it into a gallery as such

 

Miguel's list

milk        tomato          apple

 

---------------------------------------------------------------------------------------------

I understand that there is a split function that I can split it by the ',' although once split I was thinking to store it in a collection.

however, once it's in a collection a I can't think of how to work with it from there. I was thinking if I could somehow iterate the 4 seperate collections into one overall collection then I could use that collection in the gallery easily. Its just getting it from multiple collections into one. Also, yes all of the items are grouped with the other items at the same index.

Categories:
I have the same question (0)
  • Verified answer
    timl Profile Picture
    36,774 Super User 2026 Season 1 on at

    Hi @Anonymous 

    @Mr-Dang-MSFT posted a really good solution to a similar question here. Maybe this could help you?

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Create-a-gallery-from-more-than-one-set-of-comma-delimited/m-p/236356 

     

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    HI @Anonymous 

    Do you want to get a gallery like this:

    miguel's list
    apple    tomato  mile
    bob's list
    orange   celery heavy  cream
    jim's list
    banana  broccoli  half and half

    Thanks for @timl s solution, its very simple and powerful. Ive made a similar test.

    Let me show you the solution in details:

    Add a button and set its OnSelect property to (you will get the collection what you want after you select the button):

     

     

    Clear(joint_collection);
    ForAll(
     Split("miguel's list,bob's list,jim's list",","),
     Collect(
     joint_collection,
     {
     column1: Last(FirstN(Split("miguel's list,bob's list,jim's list",","),
     CountRows(joint_collection) + 1)).Result,
     column2: Last(FirstN(Split("apple,orange,banana",","),
     CountRows(joint_collection) + 1)).Result,
     column3: Last(FirstN(Split( "tomato,celery,broccoli",","),
     CountRows(joint_collection) + 1)).Result,
     column4: Last(FirstN(Split("milk,heavy cream,half and half",","),
     CountRows(joint_collection) + 1)).Result
     }))

     

     

    To be additional, here is another idea for your reference (little complex, but you can put it into the items property of the gallery):

     

     

    ShowColumns(
     AddColumns( /*add column “title3”*//*show columns “title” “title1” “title2” “title3” */
     AddColumns( /*add column “title2”*/
     AddColumns( /*add column “title1”*/
     AddColumns( /*add column “title”*/
     Concatenate( /*concatenate them to a one-column table*/
     Split(
     "miguel's list,bob's list,jim's list",
     ","
     ),
     " ", /*” “X2, it will be used as a separator*/
     Split(
     "apple,orange,banana",
     ","
     ),
     " ", /*” “X3, it will be used as a separator */
     Split(
     "tomato,celery,broccoli",
     ","
     ),
     " ", /*” “X4, it will be used as a separator */
     Split(
     "milk,heavy cream,half and half",
     ","
     )
     ),
     "title",
     Match( /*Match text in the format "XXX XXX" */
     Result,
     "\S*\s\S*"
     ).FullMatch
     ),
     "title1",
     Trim(
     Match( /*Match text in the format " XXX" */
     Result,
     "\s\s\S*"
     ).FullMatch
     )
     ),
     "title2",
     Trim(
     Match( /*Match text in the format " XXX" */
     Result,
     "\s\s\s\S*"
     ).FullMatch
     )
     ),
     "title3",
     Trim(
     Match( /*Match text in the format " XXX( XXX XXX)" */
     Result,
     "\s\s\s\s\S*\s*\S*\s*\S*"
     ).FullMatch
     )
     ),
     "title","title1","title2","title3"
    )

     

     

    Beat Regards,

    Bof

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard