Creating a flow in Power Automate:
When I test the flow, the "Parse JSON" step fails with
BadRequest. The property 'content' must be of type JSON in the 'ParseJson' action inputs, but was of type 'application/octet-stream'.
Looking at the output of the "Get file content" step
{"statusCode":200,"headers":{"Cache-Control":"no-cache","Pragma":"no-cache","Accept-Ranges":"bytes","ETag":...
,"Content-Disposition":"attachment; filename=\"File.json\""},"body":{"$con...
That is not my file content. It looks like the "file content" from OneDrive is an HTTP response.
What's going on here? What's the trick to use the content of a JSON file from OneDrive in Power Automate? The file is about 25 MB. Is there a size limit for JSON files for either OneDrive or Power Automate?
Pretty much every action that’s made to another service uses HTTP as the mechanism for doing so, hence why you see a HTTP response.
You haven’t shown the entire output but I’m 99% sure you have the content in a base64 format which is contained in the $content
property in the response. That’s pretty much confirmed by the error you’re getting.
You need to convert that to regular text using the base64ToString
function in a compose step or within your Parse JSON step.
Alternatively, adjust the switch for inferring the content type and see if that gives you what you want. If not, revert to my original approach.