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 / Parse JSON error when ...
Power Automate
Answered

Parse JSON error when a form is submitted without attachments

(0) ShareShare
ReportReport
Posted on by 189
Hello community
 
I have the following error when a form is submitted and the user does not attach any file, if a files is attached to the form t works OK. 
 
InvalidTemplate Unable to process template language expressions in action 'Parse_JSON' inputs at line '0' and column '0': 'Required property 'content' expects a value but got null. Path ''.'.
 
This is where my flow stops
 
 
I attached my schema
 
"schema": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "link": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {},
          "size": {
            "type": [
              "integer",
              "null"
            ]
          },
          "referenceId": {
            "type": [
              "string",
              "null"
            ]
          },
          "driveId": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": [
              "integer",
              "null"
            ]
          },
          "uploadSessionUrl": {}
        },
        "required": [
          "name",
          "link",
          "id",
          "type",
          "size",
          "referenceId",
          "driveId",
          "status",
          "uploadSessionUrl"
        ]
      }
 
I managed to bypass most of the required properties by adding "null" but it doesn´t work the same with "type": {}, and "uploadSessionUrl": {}.
Categories:
I have the same question (1)
  • Chriddle Profile Picture
    8,443 Super User 2025 Season 2 on at
    Remove these properties from the "required" array in the schema.
  • Verified answer
    David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    I would add a condition to check that the question contains attachments since it doesn't seem to be a required one:
     
    You would then only process the attachments if something was attached. The expression in the condition is length(outputs('Get_response_details')?['body/yourquestion'])
  • PM-13052142-0 Profile Picture
    189 on at
     
    I´ve tried that earlier but still have the same issue. I also deleted from the array
     
    {
        "type": "array",
        "items": {
            "type": "object",
            "properties": {
                "name": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "link": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "id": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "size": {
                    "type": [
                        "integer",
                        "null"
                    ]
                },
                "referenceId": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "driveId": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "status": {
                    "type": [
                        "integer",
                        "null"
                    ]
                }
            },
            "required": [
                "name",
                "link",
                "id",
                "size",
                "referenceId",
                "driveId",
                "status"
            ]
        }
    }
  • PM-13052142-0 Profile Picture
    189 on at
     
    When a form is submitted the attachment is optional but either way what comes next (create item/send an email) has to be ran. So I would need to create a conditional in each branch, right?
     
     
  • Chriddle Profile Picture
    8,443 Super User 2025 Season 2 on at
    Sorry, I misread the error message.
    This isn't about the properties in the schema.
    The input to the "Parse JSON" action ("Content") is null.
     
  • Chriddle Profile Picture
    8,443 Super User 2025 Season 2 on at
    To avoid the null value, use function coalsce() and use the empty array as default value
     
    coalesce(outputs('Compose'), json('[]'))
     
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    Try what @Chriddle posted regarding the coalesce() expression, I have never tried that, but it is creative. If that doesn't work, then yes, based on your screen shot, I think you would need to have the condition within each switch as well.
  • PM-13052142-0 Profile Picture
    189 on at
     
    I need to ask you a question regarding your solution, I´m not a very advanced user.
     
    In the compose action, should I only type null()?
     
    In the case a file is attached, If I apply the above Compose action will it still get the content despite it has been already nulled?
     
     
  • Chriddle Profile Picture
    8,443 Super User 2025 Season 2 on at
    No, the Compose is simply a placeholder for the value you want to insert into your Parse JSON
    and I set this to null to simulate your error scenario.
  • PM-13052142-0 Profile Picture
    189 on at
     
    This is how the flow looks now after applying your suggestions.
     
     
    The input in compose is the answer where the file needs to be added in the form.
     
    Then, I parsed the schema according to your comments (I kept the original schema without nulling any item)
     
     
    I´m still getting the same result.
    Action 'Parse_JSON' failed: Unable to process template language expressions in action 'Parse_JSON' inputs at line '0' and column '0': 'Required property 'content' expects a value but got null. Path ''.'.
     
    Interesting thing is that in the original flow, if someone adds an attachment to the form, the parse JSON output shows "null" in "type" and "uploasSessionsUrl".  
     

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

#2
Tomac Profile Picture

Tomac 267 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard