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 / Build Collection from ...
Power Apps
Answered

Build Collection from column with colon delimiter

(0) ShareShare
ReportReport
Posted on by 12

Hello,

 

I have a table that look like this: 


Name Pets
Tom ;Cat;Dog
Peter ;Bird;Rabbit
Mary ;Hamster

 

 and would like to get a collection from the Pets column:


Cat
Dog
Bird
Rabbit
Hamster

 

I have tried using ForAll and Split but still no luck. Would appreciate if someone can help me with this.

 

Thanks,

Kin

Categories:
I have the same question (0)
  • timl Profile Picture
    37,212 Super User 2026 Season 1 on at

    Hi Kin

    Can you confirm, is this a table with two columns called name and pets, or is this a single column table where each data row begins with the name followed by the name of the pets separated by a semicolon?

  • mdevaney Profile Picture
    29,991 Moderator on at

    @kccchiu 

    This code will produce a single column collection with a column called "Result" having all the pets.

    // Starting collection
    ClearCollect(colNamePets,
     {'Name Pets': "Tom;Cat;Dog"},
     {'Name Pets': "Peter;Bird;Rabbit"},
     {'Name Pets': "Mary;Hamster"}
    );
    
    // Solution collection
    ClearCollect(colSolution,
     Ungroup(
     AddColumns(
     colNamePets,
     "Pets", Remove(Split('Name Pets', ";"),First(Split('Name Pets', ";")))
     ),
     "Pets"
     ).Result
    );


     ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • kccchiu Profile Picture
    12 on at

    Yes, it is a 2 column table with header like you mentioned. Sorry for the confusion.

  • Verified answer
    timl Profile Picture
    37,212 Super User 2026 Season 1 on at

    @kccchiu 

    Let's assume a 2 column table that looks like this:

    ClearCollect(colNamePets,
     {'Name': "Tom", 'Pets': "Cat;Dog"},
     {'Name': "Peter", 'Pets': "Bird;Rabbit"},
     {'Name': "Mary", 'Pets': "Bird;Rabbit"}
    )

    This formula will return a table with a column called Result. This will contain a list of your pets.

    Ungroup(AddColumns(colNamePets, "PetTable", Split(Pets, ";")),"PetTable")

     

     

    timl_0-1603122546582.png

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 463

#2
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#3
11manish Profile Picture

11manish 275

Last 30 days Overall leaderboard