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 Automate / Split a list of comma ...
Power Automate
Answered

Split a list of comma delimeted strings into a multiple columns array

(0) ShareShare
ReportReport
Posted on by 18

Hi!

I have a list of coma separated strings that i wan to split into an array of multiple columns. I have tried with a combination of get and split but i could not figure out the right code. any idea? if possible without for each.

 

from this (which is actually a 1 column array)

Name,start,finish
A,2024/3/3,2024/3/5
B,2024/4/3,2024/4/5

 

to this

Namestartfinish
A2024/3/32024/3/5
B2024/4/32024/4/5

 

thanks for your help!

Categories:
I have the same question (0)
  • Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @Yann78 

     

    Could you please share the input array in the form of object? You have shared it as a table.

     

     

  • Yann78 Profile Picture
    18 on at

    Thanks for you reply Manish. did you mean sharing the table as bellow?

    [

    { "Name,Start,Finish": "A ;2024/05/23;2024/05/23" },

    { "Name,Start,Finish": "B;2024/06/23;2024/08/23" }

    ]

  • Verified answer
    Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @Yann78 

     

    Here is the sample flow.

     

    I have stored the input array in the "Compose" action:

    [
    { "Name,Start,Finish": "A ;2024/05/23;2024/05/23" },
    { "Name,Start,Finish": "B;2024/06/23;2024/08/23" }
    ]

    ManishSolanki_0-1716358244911.png

     

    Next, add "Select" action to transform the input array into the required format. We will be using expression to perform the transformation. Expression needs to be added in the expression box as shown below:

    ManishSolanki_1-1716358335226.png

    xpath(xml(json(concat('{"root":{"items":',outputs('Compose'),'}}'))),'//Name_x002C_Start_x002C_Finish/text()')

    In the Map property, enter the column name as plain text and expression in the value part:

    Map Value
    Name
    trim(first(split(item(),';')))
    Start
    trim(split(item(),';')[1])
    Finish
    trim(last(split(item(),';')))

    The output of select action will give the required array.

     

     

    Output:

    ManishSolanki_2-1716358561163.png

     

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • Yann78 Profile Picture
    18 on at

    Thanks Manish.

    The input to the SELECT is a FILTER ARRAY not a COMPOSE, so I modified the Xpath function as following

    Yann78_2-1716365925482.png

     

    {
    "type": "Select",
    "inputs": {
    "from": "@xpath(xml(json(concat('{\"root\":{\"items\":',body('Filter_excel_array'),'}}'))),'//Name_x002C_Start_x002C_Finish/text()')",
    "select": {
    "Name": "@first(split(item(),';'))",
    "Start": "@split(item(),';')[1]",
    "Finish": "@last(split(item(),';'))"
    }
    },
    "runAfter": {
    "Filter_excel_array": [
    "Succeeded"
    ]
    }
    }

    And it worked fine. thanks for your solution.

     

    By the way, there no simpler formula than the Xpath? I have no clue how to debugg it...

  • Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @Yann78 

     

    I am glad that it solves your problem 😊

     

    Yes, you are right. Its a bit complex but I could not think of other solution. You may break the formulas into simple expressions and then use compose action to understand the output of each expression. For e.g.:

     

    Expression 1: xml(json(concat('{"root":{"items":',outputs('Compose'),'}}')) 

    Expression 2: xpath(<dynamic output of previous expression 1>),'//Name_x002C_Start_x002C_Finish/text()')

     

     

     

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 Automate

#1
Vish WR Profile Picture

Vish WR 378

#2
Valantis Profile Picture

Valantis 329

#3
David_MA Profile Picture

David_MA 283 Super User 2026 Season 1

Last 30 days Overall leaderboard