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 / How to split array int...
Power Apps
Answered

How to split array into a datatable or html text box

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have an array that I store in a collection and currently I can dump the data into a data table.  I've been struggling on how I can split that array by ",".  I've tried the split function, but have had no success.  I'm also not entirely sure where the split function should be entered, either at the trigger (the button) or the datatable piece.

 

split(collection,",")

  

Screen Shot 2019-06-03 at 4.23.27 PM.png

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,621 Most Valuable Professional on at

    Do you actually have an array or a comma delimited string stored in the collection.  When I create a collection using the following code I can bind the collection directly to the datatable and each array value becomes a row.

     

    ClearCollect(mytable,["Test1","Test2","Test3"]) 

     

    Can you provide a screen shot of what is in your collection after you load the array?

  • robevans Profile Picture
    Microsoft Employee on at

    So here's my button code that collects the data from Flow Array and also what my table looks like. 

     

     

    Screen Shot 2019-06-04 at 2.15.30 PM.png

     

     

    Screen Shot 2019-06-04 at 2.15.22 PM.png

     

    Here's the body being sent over from Flow.

     

    {
     "vardata": "[\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\",\"done\"]"
    }

     

  • robevans Profile Picture
    Microsoft Employee on at

    On second look the type is a String and not an array being sent from Flow.  This should still allow to split though?

  • Pstork1 Profile Picture
    69,621 Most Valuable Professional on at

    Yes, it should allow split.  The issue may be how it interprets the string.  The escaped double quotes may still cause an issue.

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @robevans ,

    Could you please share a bit more about the result the DEV_HSRedaction.Run() formula returns? Just like ["done", "done", "done", ...., "done"] (a string value)?

    Do you want to split the ["done","done","done", ...] string value into an array into a Data Table?

     

    Based on the needs that you mentioned, I think the combination of Substitute function and Split function could achieve your needs.

    I have made a test on my side, please take a try with the following workaround:6.JPG

     

    7.JPG

    Set the Items property of the Data Table2 to following formula:

    Split(
    Substitute(
    Substitute(
    Substitute(
    Substitute(First(datafromflow).Value, "[", ""),
    "]",""
    ),
    "'",""
    ),
    " ",""
    ),
    ","
    )

    On your side, please set the Items property of the Data Table control to following:

    Split(
     Substitute(
     Substitute(
     Substitute(
     Substitute(First(datafromflow).Value, "[", ""),
     "]",""
     ),
     "'",""
     ),
     " ",""
     ), 
     ","
    )

    More details about the Substitute function and Split function, please check the following article:

    Substitute function, Split function

     

    Please take a try with above solution, check if the issue is solved.

     

    Best regards,

  • robevans Profile Picture
    Microsoft Employee on at

    Thanks @v-xida-msft that worked for the most part.  Except the quotes are still present before and after done for me, but your screenshot is showing as removed.  Did I miss a step?

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 400 Most Valuable Professional

#2
11manish Profile Picture

11manish 141 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard