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 / Parse nested 3rd level...
Power Automate
Unanswered

Parse nested 3rd level JSON record

(0) ShareShare
ReportReport
Posted on by 103
Hi,
I'm having a hard time to Parse the JSON below. It seems to be a 3 level nested JSON.
Simple passing below to PowerApps it just receives {Value:true}. I presume it's reading the first "HasChildren": true
I just want the "LocationName" and  "LocationId" for each 3rd level value, I don't need parents "Level1" and "Level2".
 
That it what I expect from the sample below::
{LocationName:"NY", LocationId:1234},{LocationName:"LA", LocationId:1235}
 
Sample Body:
 
{
  "HasChildren"true,
  "Children": [
    {
      "HasChildren"true,
      "Children": [
        {
          "HasChildren"false,
          "Children": [],
          "LocationName""NY",
          "LocationId"1234,
          "ParentId"2222,
          "HasChidren"false
        },
        {
          "HasChildren"false,
          "Children": [],
          "LocationName""LA",
          "LocationId"1235,
          "ParentId"2222,
          "HasChidren"false
        }
      ],
      "LocationName""Level2",
      "LocationId": 2222,
      "ParentId"2218,
      "HasChidren"true
    }
  ],
  "LocationName""Level1",
  "LocationId"2218,
  "ParentId"null,
  "HasChidren"true
}
Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    Are you using the Respond to Power Apps action or the HTTP response action?  The Respond to Power Apps won't work because it can only pass an object with simple properties, not an array.  You need to use the HTTP response action and provide an accurate schema to send the entire JSON object with embedded arrays back to Power Apps.

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

    Hi @Wedlib ,

     

    I did a video response to your question as it is simple to do but somewhat difficult to explain the parts of the method. Have a watch of this and see if it helps you:

    https://youtu.be/SpOcJXsB-_s

     

    Blog: tachytelic.net

    YouTube: https://www.youtube.com/c/PaulieM/videos

    If I answered your question, please accept it as a solution 😘

  • Verified answer
    Wedlib Profile Picture
    103 on at

    Hi Paulie

     

    I'm receiving the following error: 

     

    Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2521': 'The template language expression 'outputs('JSON')['Children'][0]['Children'] cannot be evaluated because property 'Children' doesn't exist, available properties are 'body'. Please see https://aka.ms/logicexpressions for usage details.'.

     

    Wedlib_0-1624295913257.png

     

  • Paulie78 Profile Picture
    8,422 Moderator on at

    You probably want:

    outputs('JSON')['body']['Children'][0]['Children']
  • Wedlib Profile Picture
    103 on at

    Thank you!!!! It's working.

     

    Just to add:

     

    With the Flow working, I was getting this error when trying to add the flow to a Button in the PowerApss:

    "Failed during http send request"

     

    Fix: Basically, just remove the  "required":[.........]. from the Responde schema

     

    Solution reference: PowerApps Flow Button returns "Failed during http ... - Page 2 - Power Platform Community (microsoft.com)

     

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard