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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Parse JSON 2 Error - N...
Power Automate
Unanswered

Parse JSON 2 Error - Need to allow null value for image upload

(0) ShareShare
ReportReport
Posted on by 8

I have a form that requires uploading a drivers license image (.jpg file) and then a condition is in place for certain members to upload an MVR image.  The intention is for the 2nd Upload File to be optional.  The Flow fails for any forms that don't upload both images.  If both images are uploaded, it works fine.  How can I program the 2nd Upload File object to accept Null values?  Is there another way to outsmart this by having a default value for the 2nd Upload File or just have it duplicate the 1st Upload File path?

 

Error:

InvalidTemplate. Unable to process template language expressions in action 'Parse_JSON_2' inputs at line '0' and column '0': 'Required property 'content' expects a value but got null. Path ''.'.
 
 
Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,485 Most Valuable Professional on at

    Do two things.

    1) Remove that column from the list of required columns in the schema.

    2) Change the Type in the schema from "Type": "Image" to "Type": ["Image", "null"]

  • drmarinko Profile Picture
    8 on at

    Thank you for the fast reply.  I am not clear on your first instruction.  How do I do this?  1) Remove that column from the list of required columns in the schema.

  • drmarinko Profile Picture
    8 on at

    Below is the Parse JSON 2 in our flow.  After the condition in the flow, there is an "Initialize variable (MVR)", then "Parse JSON 2", and then "Apply to each 2".  See attached picture.
    {
    "type": "array",
    "items": {
    "type": "object",
    "properties": {
    "name": {
    "type": "string"
    },
    "link": {
    "type": "string"
    },
    "id": {
    "type": "string"
    },
    "type": {},
    "size": {
    "type": "integer"
    },
    "referenceId": {
    "type": "string"
    },
    "driveId": {
    "type": "string"
    },
    "status": {
    "type": "integer"
    },
    "uploadSessionUrl": {}
    },
    "required": [
    "No"
    ]
    }
    }Flow1.png

  • Pstork1 Profile Picture
    69,485 Most Valuable Professional on at

    You won't need to do #2 since the columns in your required list are already very limited.  The only column you list as required is "No". Did you create the schema by hand or by using the sample button?

  • drmarinko Profile Picture
    8 on at

    The schema was done by a Tech that no longer works here, but I think he did a copy/paste from another forum.  I am open to suggestion on changing the schema, but I don't claim to understand it well enough to customize for our needs.  In the Form, we limit it to 1 file, size limit 100MB, with type Word Excel PPT PDF or Image.  The first Upload file object is Required and the 2nd is Not Required.  Open to any suggestions on the schema.

  • Matthy79 Profile Picture
    4,188 Super User 2024 Season 1 on at

    Hello,

     

    The schema is not the problem, but if you parse the JSON and the content to parse has no value, you have nothing to parse.

     

    You could check for the null value, but that won’t solve your problem, because I am pretty sure that somewhere after that action, you will need content from the parse json.

     

    So you have to check what is really causing the problem. You normally can’t parse an image by using json parse. So what do you parse here and why is there no data available?

  • drmarinko Profile Picture
    8 on at

    The form has 2 sections for uploading files and works fine when a file is uploaded for each.  There are conditions when only 1 file is needed and the 2nd is not.  Those conditions are failing since null value for the image upload.  Am I supposed to use something other than Parse JSON to upload an image and allow null? 2ndUpload.png

  • Pstork1 Profile Picture
    69,485 Most Valuable Professional on at

    I would use sample output from the form details in a run to generate a new schema.  Then you can set the fields that may be null to allow either the specific type or null. @Matthy79 is correct that you will then have to take into account that those fields may be null later in your flow.  But the schema for the parse JSON is indeed the problem.  The only other alternative is to make uploading each of the files required.

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 538

Last 30 days Overall leaderboard