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.