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

Community site session details

Session Id :
Power Automate
Unanswered

Parse JSON

(0) ShareShare
ReportReport
Posted on by 28
I am trying to create a Flow that takes data from an MS Form submission and creates an item in a SharePoint list. The MS Form includes an upload image option.

The Flow works without the image part.

I tried following a few YouTube videos explaining how to use the Parse JSON action to extract the image data from the submitted form. The flow fails when trying to Parse with the error “the schema validation failed”.
I did notice that when I copy/paste the sample schema as shown in those videos that instead of seeing the full code the Parse action schema box condenses it to
 {
    "type": "string"
}
I do not know if this is what is supposed to happen or that it happens because of how I am pasting the data.
I feel pretty confident that I am copying the correct data point associated with the upload image question on the Form.
Categories:
I have the same question (0)
  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at
    Parse JSON
    Please share you JSON Schema and JSON Input.
    I will take a look.
     
  • Gyllentid Profile Picture
    894 on at
    Parse JSON
    Add the action Compose, add the data you want to select for the Parse Json action. Run the flow. Copy the data you get in the compose. Use the copied content when you add the Parse json action, it can create that from a sample.
  • ghswebmaster Profile Picture
    28 on at
    Parse JSON
    Thank you both for responding.
    I added a Compose and ran it. I copied the following to paste in the “use sample’ box on the Parse action
    "[{\"name\":\"paw no background_Sample.png\",\"link\":\"https://xxxxx-my.sharepoint.com/personal/xxxx_xxxxxx_net/Documents/Apps/Microsoft%20Forms/wills/Question/paw%20no%20background_Sample%20Lz.png\",\"id\":\"016TDMZRWQRCJRCNNCNRFIB5T2UJFY3WRK\",\"type\":null,\"size\":102176,\"referenceId\":\"016TDMZRR3OBYPKIEHMZBZN5IFZPW67XJV\",\"driveId\":\"b!JIckI1asUEOH96f_MO19B64HU01a83ZMgqAt4sOXuwD9V20IyonDRrZPHNd4iLMf\",\"status\":1,\"uploadSessionUrl\":null}]"
    Right after I added this, the schema box showed this
    {
        "type": "string"
    }
    When I tried the Flow again, I still get the “schema validation failed” message. When I look at the raw inputs it is identical to what I copied to the “sample schema”
     
  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at
    Parse JSON
    Use this schema.
     
    ​​​​​​​
  • Suggested answer
    SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at
    Parse JSON
    Use this schema
     
     
     
    {
     
        "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"
     
            ]
     
        }
     
    }
  • ghswebmaster Profile Picture
    28 on at
    Parse JSON
    Sudeep,
    Thank you again for taking the time to respond. The validation still fails. The issue is what is being parsed. In both cases (my initial schema and your schema), the error is due to the input being in array format.
    {
        "errors": [
            {
                "message": "Invalid type. Expected Object but got Array.",
                "lineNumber": 0,
                "linePosition": 0,
                "path": "",
                "schemaId": "#",
                "errorType": "type",
                "childErrors": []
            }
        ]
    }


    I have tried using the Compose action to convert the array to a string, but either my configuration is wrong or what I am trying to do is not doable.
    string(outputs('Get_response_details')?['body/rf992efdfb62249acb47fe3bd3969914e'])
  • Verified answer
    ghswebmaster Profile Picture
    28 on at
    Parse JSON
    This video solved my issue
     

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

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard