Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

Parse_JSON_of_File_Upload Failed Error Message in Flow

Posted on by 14
I created a power automate flow for our own internal ticketing system. Flow uses MS Forms > Creates task in MS Planner > Bot notifications are in Teams. It seems like some of the requests are not coming through. I'm getting this error message, 


Error: Action 'Parse_JSON_of_File_Upload' failed
Unable to process template language expressions in action 'Parse_JSON_of_File_Upload' inputs at line '0' and column '0': 'Required property 'content' expects a value but got null. Path ''.'.


I originally fixed it but updating the "create a task" step after my scope handle attachments step to "is successful" and "has failed" most all requests come through okay but for some reason I'm getting this error message from a couple users who submitted their requests in forms. 
  • LP-14051427-0 Profile Picture
    LP-14051427-0 14 on at
    Parse_JSON_of_File_Upload Failed Error Message in Flow
    Thanks for taking the time to review this with me! Very much a newbie when it comes to power automate. I been using YT guides to help me build out my process. The YT guide that I linked below shows using JSON and it work perfectly the last two years but for some reason, I'm getting these null errors. 

    Main process of the JSON is to upload the file into our task in M365 planner. We have a question in our M365 Forms where the end user can attach a screenshot when they submit a request. I followed a guide on this YT video that helped with this process. 1st screenshot is the steps I use in my flow. 2nd screenshot shows where that output is going to. 

    The only condition that I have if there is no file upload is using the configure run after. I updated the settings for my "create a task in planner" should run after if the "scope: handle attachments" is successful or skipped. It seems to work fine most of the time but for some reason I'm getting these null errors all the sudden. 3rd screenshot 

    4th screenshot is the error message I'm getting for Error: Action 'Parse_JSON_of_File_Upload' failed
    Unable to process template language expressions in action 'Parse_JSON_of_File_Upload' inputs at line '0' and column '0': 'Required property 'content' expects a value but got null. Path ''.'.
    1st screenshot

    2nd screenshot

    3rd screenshot

    4th screenshot
  • Mark Nanneman Profile Picture
    Mark Nanneman 329 on at
    Parse_JSON_of_File_Upload Failed Error Message in Flow
    Can you show a screenshot of the Parse JSON action in your flow?  I don't see it in your screenshots.
     
    What is it doing/what's its purpose?  That is, where are you using things that Parse JSON outputs?

    Have you tried putting a condition above the Parse JSON so that it won't run if there's no uploaded file?

    I personally almost never use Parse JSON--it's just too fragile.  In most cases it's just smarter to just directly reference the property you want from the array or object.  E.g.  "outputs('Your_data_object')?['property_name']"
  • LP-14051427-0 Profile Picture
    LP-14051427-0 14 on at
    Parse_JSON_of_File_Upload Failed Error Message in Flow
    @Mark - my schema is a bit different from what you have written in your post. Here is what I have in my flow. I did add the "null" in the type section but it still gives me the same error code when I resubmit the flow that failed for me

    {
        "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": [
                "name",
                "link",
                "id",
                "type",
                "size",
                "referenceId",
                "driveId",
                "status",
                "uploadSessionUrl"
            ]
        }
    }
     
  • Suggested answer
    Mark Nanneman Profile Picture
    Mark Nanneman 329 on at
    Parse_JSON_of_File_Upload Failed Error Message in Flow
    If you want your "Parse JSON" action to run even if it encounters a null value where it isn't expecting one, you simply have to update it to accept nulls.  By default the "Parse JSON" action only accepts data of the type it was trained on in the initial "sample JSON payload" you gave it.

    Find the "content" property in your "Parse JSON" schema and edit it's child "type" property.  
     
    Example:
    {
        "type": "object",
        "properties": {
            "content": {
                "type": "object",
                "properties": {}
            }
        }
    }

    Change the "type" property from "object" to an array including "object" and "null".  Now the Parse JSON will accept nulls as well as objects.


    If this helped you, please click "Does this answer your question" and give it a like to help others in the community (+ close the ticket)!

    Power Platform Developer | LinkedIn: Mark Nanneman | Blog: Power Stuff  | YouTube: Mark's Power Stuff  | Buy me a coffee

     

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,487

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,014

Leaderboard