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 list columns to ...
Power Apps
Answered

Split list columns to a new collection

(0) ShareShare
ReportReport
Posted on by 11
Hello, 

 

I'm a pretty novice user in PowerApps
I have a sharepoint list with three columns (ID,Tasks,Completed)
I have two columns that contain a text string with values separated by a separator ", ".  The number of these values is variable.

What I'm trying to achieve is to split the two columns and create a new collection with the split result, with as many columns as needed and thus be able to display it in a gallery.

 

Here is an example: 

 

IDTasksCompleted
32423My Task1,My Task2,My Task3true,false,true

 

I need something like;

 

IDTasks1Tasks1Tasks2Completed1Completed2Completed3
32423My Task1My Task2My Task3truefalsetrue

 

Remember: The number of these values is variable.

Is it possible? 

Categories:
I have the same question (0)
  • developerAJ Profile Picture
    4,664 on at

    if the number of values in column is dynamic we wont be able to convert into as per you requirement. it should be static

    you can define max columns limit lets say 10 task or something than you can use addcolumns() to fulfil your requiremnt .

     

    Please click Accept as solution and Thumbs Up. if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    You can connect with me on LinkedIn

  • JOTAELECD Profile Picture
    11 on at

    Thank you for your answer

     

    And what would it be like for a limited number? Because I have not managed to do it either with the instructions I have found here. I always have mistakes.

  • Verified answer
    developerAJ Profile Picture
    4,664 on at

    Use this as reference

     

    You can use on Any Test button to check code:

    ClearCollect(colTest,{ID:1,Tasks:"Task1,Task2,Task3",Completed:"true,false,true"},{ID:2,Tasks:"Task1,Task3,Task4",Completed:"true,true,true"},{ID:3,Tasks:"Task3,Task2,Task1",Completed:"true,false,true"},{ID:4,Tasks:"Task1,Task2,Task3",Completed:"false,false,true"});
    ClearCollect(ColCon,AddColumns(colTest,"Tas1",First(Split(Tasks,",")).Value,"Tas2",Last(FirstN(Split(Tasks,","),2)).Value,"Tas3",Last(FirstN(Split(Tasks,","),3)).Value,"Com1",First(Split(Completed,",")).Value,"Com2",Last(FirstN(Split(Completed,","),2)).Value,"Com3",Last(FirstN(Split(Completed,","),3)).Value))

     

    Please click Accept as solution and give it Thumbs Up if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    You can connect with me on LinkedIn

     

    developerAJ_1-1687791662059.png

    developerAJ_2-1687792040078.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

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard