web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / JSON unable to return ...
Power Automate
Answered

JSON unable to return specific property value

(0) ShareShare
ReportReport
Posted on by 15

Hi,
I am looking at how I could use Power Virtual Agents / Power Automate instead of the bot SDK, seeing what the limitations are. I have run into a problem working with JSON, trying to navigate to a property to get a value.


Dummy JSON:

{
 "locationz": { 
 "woods":"Branston",
 "field":"Rick",
 "house":"burger"
 },
 "check":"yes"
}

 

I've checked the above and can retrieve Branston outside of Power Automate, so that's valid.

 

The JSON file is in OneDrive and using 'Get File Content' to access the JSON.

In Power Automate I have tried two things with the same results:

  • Using Compose: body('Get_file_content')
  • Or Compose: outputs('Get_file_content')?['body']

Either of the above returns the JSON above, as I would expect, so the "query" and file retrieval are both working, as are the outputs.

 

It goes wrong when I try to retrieve just the 'locationz' property - using the following, both of which should work, according to the docs:

  • Compose: outputs('Compose')?['locationz']
  • Or Compose: outputs('Get_file_content')?['body']?['locationz']

As soon as I try and go to the next level in JSON the result is coming back empty.

 

I have tried:

  • Different variations of ?['body']?['locationz'] in both of the scenarios above, adding and removing elements
  • For the JSON file itself, I have tried turning 'Infer Content Type' on and off

Any ideas? I have searched and found a bunch of different docs and posts on how to get JSON - tomriha's Let's Power Automate was very helpful. I want to just navigate to the property value I want rather than having add steps to parse JSON - I have not looked into that as I don't want to add more complexity than I would using the sdk. Hoping for someone to tell me I'm doing something stupid.

Categories:
I have the same question (0)
  • MarconettiMarco Profile Picture
    3,812 Super User 2024 Season 1 on at

    Hello @Powerline ,

    have you tried to use the "Parse JSON" action? you can put the Content based on your Trigger or previous Action, then, by clicking on the "Generate from sample", add your JSON payload

    MarconettiMarco_0-1657633770890.png

     

    I've tested your body, and I'm able to get all the properties:

    MarconettiMarco_1-1657633901696.png

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    BR,

    Marco

     

     

  • Powerline Profile Picture
    15 on at

    @MarconettiMarco thank you for that. I had seen this approach / option - as mentioned I want to get the option of navigating to the value as it's simpler so haven't explored this approach. Direct navigation is also more flexible, if it works. 

  • MarconettiMarco Profile Picture
    3,812 Super User 2024 Season 1 on at

    Hello @Powerline 

    I've tried to use the following expression and it works:

    outputs('Compose')?['locationz']

     

    MarconettiMarco_0-1657635007888.png

     

    MarconettiMarco_1-1657635064216.png

     

     

    Are you sure that the Action name you want to grab is named "Compose"?

     

    BR,

    Marco

     

     

  • Powerline Profile Picture
    15 on at

    That's not worked for me but after your post @MarconettiMarco I added the Parse JSON action and getting an error now which has highlighted the problem, the way Power Automate is treating the file: 

    "$content-type""application/octet-stream"
    Really appreciate the input, given me something solid to chase down.
  • Verified answer
    Powerline Profile Picture
    15 on at

    Building on what Marco shared led me to create this which has solved it, having looked at a few posts elsewhere:

    powerautomate.png

     

    Get File Content is pointed at a JSON file in OneDrive. Then the flow:

     

    For the action, fixing: 

    json(base64ToString(body('Get_File_content')['$content']))

     

    And for digging: 

    outputs('fixing')?['locationz']?['woods']

    The solution goes to the property for woods (which is hardcoded here), next step will be mapping this to a user value input from the Power Virtual Agent.

    The reason I am using this method instead of Parse JSON is it allows anyone to update the underlying JSON and dynamically call that from a bot without having to alter the Flow, Parse JSON action; for example if someone added "locationz": { "road":"value"... 

    Parse JSON looks like a good option where the schema is fixed.

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!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 239 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 177 Super User 2026 Season 1

#3
Kalathiya Profile Picture

Kalathiya 97 Super User 2026 Season 1

Last 30 days Overall leaderboard