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 / Modify Data Table in P...
Power Apps
Answered

Modify Data Table in Powerapps

(0) ShareShare
ReportReport
Posted on by 143

ClearCollect(MyCollection, 'Copyof-DBProcessFlow'.Run(1,"spTest"))

 

I'm storing in MyCollection in Powerapps datatable and it returns value from PowerAutomate like this

 

id filename createdon
[1,2] ["sss.jpg","sss.jpg"] ["2023-05-04T11:57:58.443","2023-05-04T11:57:58.443"]


I want to split data based on comma and remove "" .. like this

 

id filename createdon
1 sss.jpg 2023-05-04T11:57:58.443
2 sss.jpg 2023-05-04T11:57:58.443

Categories:
I have the same question (0)
  • victorcp Profile Picture
    2,350 Moderator on at

    Hi,

    It was a bit complex but I will try to explain:

    First I used regex to get the id's, filename's and createdon's and save it in a variable called vRegex and then loop for each item and create a collection named colFinal:

    With(
     {items:MatchAll(Substitute(Label5.Text,"""",""),"(?<=\[)[^\]]*?(?=\])").FullMatch},
     Set(
     vRegex,
     {
     id:Split(Index(items.FullMatch,1).FullMatch,","),
     filename:Split(Index(items.FullMatch,2).FullMatch,","),
     createdon:Split(Index(items.FullMatch,3).FullMatch,",")
     }
     )
    );
    
    ClearCollect(
     colFinal,
     ForAll(
     Sequence(CountRows(vRegex.id)),
     {
     id:Index(vRegex.id, ThisRecord.Value).Value,
     filename:Index(vRegex.filename, ThisRecord.Value).Value,
     createdon:Index(vRegex.createdon, ThisRecord.Value).Value
     }
     )
    );

     

    And this is the result:

    victorcp_0-1683195282575.png

     

    Any doubts please let me know

  • sahachiranjit32 Profile Picture
    143 on at

    Hi @victorcp , I'm storing data in collection (MyCollection), data is coming from power automate. How do I use substitute function in collection

  • victorcp Profile Picture
    2,350 Moderator on at

    Hi,

    So can you take a screen shot of your collection and paste it here please?

  • sahachiranjit32 Profile Picture
    143 on at

    Hi @victorcp ,

     

    ClearCollect(MyCollection, 'Copyof-DBProcessFlow'.Run(1,"spTest"))

     

    This code returs as follows in DataTable

    sahachiranjit32_0-1683609827687.png

     

  • Verified answer
    victorcp Profile Picture
    2,350 Moderator on at

    sorry, I thought it was a string, in this case try this:

    With(
     {item:First(MyCollection)},
     Set(
     vRegex,
     {
     id:Split(Substitute(Substitute(item.id,"[",""),"]",""),","),
     filename:Split(Substitute(Substitute(item.filename,"[",""),"]",""),","),
     createdon:Split(Substitute(Substitute(item.createdon,"[",""),"]",""),",")
     }
     )
    );
    
    ClearCollect(
     colFinal,
     ForAll(
     Sequence(CountRows(vRegex.id)),
     {
     id:Index(vRegex.id, ThisRecord.Value).Value,
     filename:Index(vRegex.filename, ThisRecord.Value).Value,
     createdon:Index(vRegex.createdon, ThisRecord.Value).Value
     }
     )
    );
  • sahachiranjit32 Profile Picture
    143 on at

    @victorcp , Thank you so much 🙂

     

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

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard