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 / The property 'content'...
Power Automate
Unanswered

The property 'content' must be of type JSON in the 'ParseJson' action inputs, but was of type 'image/png' error

(1) ShareShare
ReportReport
Posted on by 248

Hi, I'm running into the following error: "The property 'content' must be of type JSON in the 'ParseJson' action inputs, but was of type 'image/png'."  

 

I'm using an HTTP action to call an external API that only turns the two objects shown in the image.  How would I parse this as JSON or fix this error?

 

2020-10-27_15-29-45.jpg

Categories:
I have the same question (0)
  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    Hello @cbernier12 

     

    Can you use the expression Json(<''Your HTTP Trigger Body>) 

    in the 'Parse JSON' action.

     

    If that does not work, can you share a sample of the trigger body

  • cbernier12 Profile Picture
    248 on at

    @Jcook 

    The trigger is Power Apps with a bunch a variables sent over then I run the HTTP action with those variables to create the base64 image string (QR code).  The values of $content and $content-type are all the output I have to work with.  When sent back to Power Apps it says it needs to be in the for of a JSON array to populate the collection with the values.  Not sure how to do that in Power Automate though.  I some how need to make a valid JSON array from the two values returned from the HTTP query.

  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    Hi @cbernier12 

     

    Could you share a screenshot of your full flow.

     

    What are you passing into the Parse JSON action? Is it possible to change/add header in the HTTP action to have 

    Content-Type: application/json

     

  • cbernier12 Profile Picture
    248 on at

    Hi adding the header didn't work, the content type remains as image/png.

     

    I need to convert the following HTTP result to json, is that possible?

     

    {
      "$content-type""image/png",
      "$content""iVBORw0KGgoAAAANSUhE...etc..."
    }
  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    Hello @cbernier12 

     

    It looks like Power Automate is trying to use the picture itself and not the values.

     

    I got around this by converting the JSON image into a JSON Array.

    Jcook_0-1603922043272.png

     

  • cbernier12 Profile Picture
    248 on at

    So for compose would I use the "body" of the HTTP output?

     

    For initialize variable what's the function look like in the value field?  I can't tell from the image.

     

    In the parse json action, where is the array value coming from and where did you get the schema?

  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    Hi @cbernier12 

     

    1. So you don't need a Compose. I am just using a Compose action to simulate your HTTP Body. So instead of using Compose, use the HTTP Body.

     

    2. The expression for the variable is:

    array(outputs('Compose'))

    Replace the Compose with

    array(<HTTP BODY>)

     

    3. The array value is the Array Variable that we used the array() expression. From step 2, notice how the name of my variable is 'array'

    Here is the schema:

    {
     "type": "array",
     "items": {
     "type": "object",
     "properties": {
     "$content-type": {
     "type": "string"
     },
     "$content": {
     "type": "string"
     }
     },
     "required": [
     "$content-type",
     "$content"
     ]
     }
    }

     

     

  • cbernier12 Profile Picture
    248 on at

    Ok what I added is initialize variable, parse JSON, and Response actions and the output looks ok, however the actual values don't make to the Power Apps collection, the columns do, just not the values.  Any idea on how to send the the values of content-type and content to Power Apps?  The flow is run from Power Apps and as stated the two columns in the collection are created.

     

    This is the successful output in the Response action:

    [
      {
        "$content-type""image/png",
        "$content""iVBORw0KGgoAAAANSUhEUgAAAJYAAACWAQMA.........."
      }
    ]
  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    Hi @cbernier12 

     

    What exactly is the expected outcome? Are you trying to get the Image into Power Apps?

  • cbernier12 Profile Picture
    248 on at

    Need both values for content and content-type to show up in the Power Apps collection.

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

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard