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 Automate / Split comma delimited ...
Power Automate
Answered

Split comma delimited (array) string variable to list separated by newline

(0) ShareShare
ReportReport
Posted on by 4

I have a flow that's collecting a list into a string variable, output similar to,

 

["one","two","three"]

 

But I need to convert this to a list separated by a newline, ie,

 

One

Two

Three

 

I'm currently using a split(variables('string'), ',') compose action, but the input / outputs are identical,

 

["one","two","three"]

 

I had planned to then strip additional quotes / square brackets in following actions.

 

Is what I'm trying to achieve possible, if so are there any examples of how?

Categories:
I have the same question (0)
  • Paulie78 Profile Picture
    8,422 Moderator on at

    Your string is actually an array. So you could do something like this:

    2020-12-08_09-59-11.png

     

    The expression used is:

    join(variables('array'), decodeUriComponent('%0A'))
  • madshaun1984 Profile Picture
    4 on at

    Thanks!

     

    I'm testing this now (the flow takes ~7h to complete currently... due to huge slowness of an apply to each loop (1538 entries iterated to build out the comma separated list)).

  • madshaun1984 Profile Picture
    4 on at

    Update: Running test using partial results from my flow, reveals this is not working.

     

    Using your example, if you initialize "array" as a string variable (I'm appending each item of the list to the string var in a prior apply to each), then use a compose step "split(variables('array'), ',')" before finally joining the split composes output, the result is not as expected (the split doesn't seem to actually output an array).

     

    madshaun1984_1-1607430654691.png

    madshaun1984_2-1607430685640.png

    madshaun1984_3-1607430721843.png

     

    Thanks

  • Verified answer
    Paulie78 Profile Picture
    8,422 Moderator on at

    It's already in the format of an array. You don't need to split or do any of that stuff. Just create an array variable (as an array variable) and put in your string, which is constructed as an array as the input.

     

    Make it even easier on yourself and instead of appending to a string variable in your prior steps, simply append the value to an array variable. 

    You've made it much more complicated than it needs to be.

  • Jake_PA_BS Profile Picture
    4 on at

    Hello,

     

    I used 

    join(variables('array'), decodeUriComponent('%0A'))

    for my array to make it appear on new lines, but it does not when Outputs is clicked in the emai.

     

    The email still comes through as the same line, the text in value 1 comma text in value 2

  • tjlyons65 Profile Picture
    14 on at

    A year later, I have the same issue - output of the join expression above still outputs the data on one line with commas.

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard