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 / GETTING ROWS AND COLUM...
Power Apps
Answered

GETTING ROWS AND COLUMNS FROM JSON | REGEX | MATCHALL

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I extracted this JSON from excel using PowerAutomate :

 

{"Actual Start Datetime":"Oct 31,2018 10:35:03","Reported Datetime":"Oct 31,2018 10:33:08","Actual Start Date {c}":"31-10-2018"};{"Actual Start Datetime":"Oct 31,2018 10:35:03","Reported Datetime":"Oct 31,2018 10:33:08","Actual Start Date {c}":"31-10-2018"};

BEAUTIFY:
{
"Actual Start Datetime":"Oct 31,2018 10:35:03",
"Reported Datetime":"Oct 31,2018 10:33:08",
"Actual Start Date {c}":"31-10-2018"
};
{
"Actual Start Datetime":"Oct 31,2018 10:35:03",
"Reported Datetime":"Oct 31,2018 10:33:08",
"Actual Start Date {c}":"31-10-2018"
};

 

 I need to catch data using regex and then put it into collection.

To get only, for example, "Actual Start Datetime" I used : 

 

ClearCollect(
 colContent,
 MatchAll(
 varContent,
 """Actual Start Datetime"":""(?<ActualStartDatetime>[^""]*)""" 
 )
);

 

 

And it works, but I have troubles getting the rest at the same time, I tried using : 

 

 

ClearCollect(
 colContent,
 MatchAll(varContent,
 """Actual Start Datetime"":""(?<ActualStartDatetime>[^""]*)""",
 """Reported Datetime"":""(?<ReportedDatetime>[^""]*)""",
 """Actual Start Date {c}"":""(?<ActualStartDatec>[^""]*)"""
 )
);

 

 

And it doesn't work , the problem is probably in the way I use "," at the end of expression to separate columns I am not very familiar with regex, APPRICIATE ENY HELP

Categories:
  • Verified answer
    timl Profile Picture
    37,306 Super User 2026 Season 2 on at

    @Anonymous 

    If your aim is to extract all 3 fields, I'd recommend calling the ParseJSON function because it's designed for this task. You'll need to enable ParseJSON in the settings of your app and this is the formula that you would use.

     

    Set(varContent,
    "{
    ""Actual Start Datetime"":""Oct 31,2018 10:35:03"",
    ""Reported Datetime"":""Oct 31,2018 10:33:08"",
    ""Actual Start Date {c}"":""31-10-2018""
    };
    {
    ""Actual Start Datetime"":""Oct 31,2018 10:35:03"",
    ""Reported Datetime"":""Oct 31,2018 10:33:08"",
    ""Actual Start Date {c}"":""31-10-2018""
    }"
    );
    ClearCollect(colContent, 
    ForAll(
     Table(ParseJSON("[" & Substitute(varContent,";",",") & "]")),
     {
     ActualStartDateTime:Text(Value.'Actual Start Datetime'),
     ReportedDateTime:Text(Value.'Actual Start Datetime'),
     ActualStartDateTimeC:Text(Value.'Actual Start Date {c}')
     }
    )
    )

    timl_0-1663756938549.png

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

     

    YES THANK YOU, so in future cases in what situations do I use ParseJson? Or do I always use it when dealing with JSON

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard