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 / Using ParseJSON inside...
Power Apps
Unanswered

Using ParseJSON inside Power Apps Canvas App to parse a JSON String rather than JSON object

(0) ShareShare
ReportReport
Posted on by 139

Hello Team,
I am trying to parse JSON string using ParseJSON() method in the Canvas App. However, it looks like it's expecting a JSON object as an input rather than a JSON string. I have no issues if I parse that JSON string to a JSON object using JavaScript and then pass it to this ParseJSON().

 

// JSON String
"{\"changedAttributes\":[{\"logicalName\":\"cre1a_app_modified_on\",\"oldValue\":\"06/23/2022 17:06:41\",\"newValue\":\"01/09/2023 20:55:22\"},{\"logicalName\":\"cre1a_order_summary_ml\",\"oldValue\":null,\"newValue\":\"testing order summary update audit\"},{\"logicalName\":\"cre1a_order_notes_ml\",\"oldValue\":null,\"newValue\":\"<p>testing order notes audit</p>\"}]}"

//JSON Object
{
 "changedAttributes": [
 {
 "logicalName": "cre1a_app_modified_on",
 "oldValue": "06/23/2022 17:06:41",
 "newValue": "01/09/2023 20:55:22"
 },
 {
 "logicalName": "cre1a_order_summary_ml",
 "oldValue": null,
 "newValue": "testing order summary update audit"
 },
 {
 "logicalName": "cre1a_order_notes_ml",
 "oldValue": null,
 "newValue": "<p>testing order notes audit</p>"
 }
 ]
}
/* Logic implemented inside the PowerApps. This works when we pass JSON object to Label1 but not JSON String */
ClearCollect(
 colGalleryItems,
 ForAll(
 Table(ParseJSON(Label1.Text).changedAttributes),
 {
 logicalName: Text(Value.logicalName),
 oldValue: Text(Value.oldValue),
 newValue: Text(Value.newValue)
 }
 )
)

 

I am getting this JSON string from a custom connector which needs to be parsed inside Canvas App to display in a gallery. Let me know if this is feasible ins PowerApps, otherwise, what are my ways to transform this response inside the custom connector itself? The above JSON String is changedata value inside the JSON something like below.

 

{
 "_objectid_value@OData.Community.Display.V1.FormattedValue": "111",
 "createdon": "2023-01-09T20:55:22Z",
 "versionnumber": 0,
 "changedata": "{\"changedAttributes\":[{\"logicalName\":\"cre1a_app_modified_on\",\"oldValue\":\"06/23/2022 17:06:41\",\"newValue\":\"01/09/2023 20:55:22\"},{\"logicalName\":\"cre1a_order_summary_ml\",\"oldValue\":null,\"newValue\":\"testing order summary update audit\"},{\"logicalName\":\"cre1a_order_notes_ml\",\"oldValue\":null,\"newValue\":\"<p>testing order notes audit</p>\"}]}"
}

 

I referred to this article too https://powerusers.microsoft.com/t5/Power-Apps-Experimental-Features/ParseJSON-feedback/m-p/1877977#M200

Thanks,
Srinivas

Categories:
I have the same question (0)
  • SJC Profile Picture
    32 on at

    You need to iterate through the result of ParseJSON to extract the data explicitly.

    See ParseJSON function in Power Apps - Power Platform | Microsoft Learn

     

    ForAll( ParseJSON( JsonString ).array, { id: Value(ThisRecord.id), name: Text(ThisRecord.name) })

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 476

#2
WarrenBelz Profile Picture

WarrenBelz 365 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 339

Last 30 days Overall leaderboard