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 / split values into a table
Power Apps
Unanswered

split values into a table

(0) ShareShare
ReportReport
Posted on by

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,383 Super User 2025 Season 2 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
    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

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard