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

Community site session details

Session Id : LdU0u0SFfrgwemw9whihUg
Power Apps - Building Power Apps
Answered

split values into a table

Like (0) ShareShare
ReportReport
Posted on 17 Mar 2020 13:49:26 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.

I have the same question (0)
  • v-bofeng-msft Profile Picture
    on 18 Mar 2020 at 09:36:25
    Re: split values into a table

    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

  • Verified answer
    timl Profile Picture
    35,708 Super User 2025 Season 2 on 17 Mar 2020 at 14:14:35
    Re: split values into a table

    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 

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 892 Most Valuable Professional

#2
Power Apps 1919 Profile Picture

Power Apps 1919 356

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 310 Super User 2025 Season 2

Last 30 days Overall leaderboard
Loading started
Loading complete