cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ClaireAllen
Post Prodigy
Post Prodigy

Parse JSON - ValidationFailed: The schema validation failed

Hello Community,

 

I need your help please

 

My flow has failed and I am not sure why, as I have not changed anything

the error that I receive is Action 'Parse JSON' Failed,

 

This is the error

 

[
  {
    "message""Invalid type. Expected Object but got Array.",
    "lineNumber"0,
    "linePosition"0,
    "path""",
    "schemaId""#",
    "errorType""type",
    "childErrors": []
  }
]
 
 
Can anyone explain the error, and assistance to resolve it please?
Thank you in advance
Claire
1 ACCEPTED SOLUTION

Accepted Solutions
manuelstgomes
Super User II
Super User II

Hi @ClaireAllen 

 

I think the issue is in the "childErrors". The [ ] means that it's an array and the schema is probaby defined like childErrors: "string"

 

A trick to solve this is to check the run and fetch the full JSON that is provided to the "Parse JSON". Copy it and then add it to the "Generate from sample".

Screenshot_2021-02-03_at_15_18_57.png

 

Can you please confirm?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

View solution in original post

7 REPLIES 7
manuelstgomes
Super User II
Super User II

Hi @ClaireAllen 

 

I think the issue is in the "childErrors". The [ ] means that it's an array and the schema is probaby defined like childErrors: "string"

 

A trick to solve this is to check the run and fetch the full JSON that is provided to the "Parse JSON". Copy it and then add it to the "Generate from sample".

Screenshot_2021-02-03_at_15_18_57.png

 

Can you please confirm?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

View solution in original post

@manuelstgomes I'm receiving the same error. I tried the above solution and pasted the JSON into the "Generate from sample" box. But when I run the test, I get the same error. Here is my JSON:

 

{
    "type": "object",
    "properties": {
        "statusCode": {
            "type": "string"
        },
        "body": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "Id_TraineeSignedTask": {
                        "type": "integer"
                    },
                    "Trainee_Id": {
                        "type": "integer"
                    },
                    "Task_Id": {
                        "type": "integer"
                    },
                    "TraineeSignature": {
                        "type": "string"
                    },
                    "TraineeSignatureTime": {
                        "type": "string"
                    },
                    "TrainerAtTimeOfTraineeSignature": {},
                    "CourseVersion_Id": {
                        "type": "integer"
                    },
                    "Note": {
                        "type": "string"
                    },
                    "Id_TrainerSignedTask": {},
                    "TraineeSignedTask_Id": {},
                    "TrainerSignature": {},
                    "TrainerSignatureTime": {},
                    "TrainerName": {},
                    "TaskStatus": {
                        "type": "string"
                    }
                },
                "required": [
                    "Id_TraineeSignedTask",
                    "Trainee_Id",
                    "Task_Id",
                    "TraineeSignature",
                    "TraineeSignatureTime",
                    "TrainerAtTimeOfTraineeSignature",
                    "CourseVersion_Id",
                    "Note",
                    "Id_TrainerSignedTask",
                    "TraineeSignedTask_Id",
                    "TrainerSignature",
                    "TrainerSignatureTime",
                    "TrainerName",
                    "TaskStatus"
                ]
            }
        }
    }
}

 

 

manuelstgomes
Super User II
Super User II

Hi @ClaireAllen  and @Justinrr07 

 

Can either of you please send me a sample of the data so that I can try to create a Flow that simulates the error? Then it's easier to provide instructions in how to fix it.

 

Cheers
Manuel

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hello @manuelstgomes 
I don't have an issue anymore as you kindly helped me resolve my issue,
@Justinrr07  is the user that currently requires your help

 

Regards

Claire

@manuelstgomes thank you for your reply.

 

Here is a link to some sample data: Sample Data 

manuelstgomes
Super User II
Super User II

Hey @ClaireAllen 

Glad that the issue is solved.

@Justinrr07 thanks. I'll try to simulate it.

Cheers
Manuel

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

sonali1
New Member

@manuelstgomes Can you help to solve this error. I am also facing the same issue for below JSON:

{"BusinessUnitId":"933d2689-83db-eb11-bacb-000d3abfc550","CorrelationId":"cf09686a-884e-4407-a6e7-1ab2ec9dd25b","Depth":1,"InitiatingUserAzureActiveDirectoryObjectId":"00000000-0000-0000-0000-000000000000","InitiatingUserId":"0e7bd821-9efa-eb11-94ef-000d3abe1c35","InputParameters":[{"key":"Target","value":{"__type":"Entity:http:\/\/schemas.microsoft.com\/xrm\/2011\/Contracts","Attributes":[{"key":"coe_requeststatus","value":{"__type":"OptionSetValue:http:\/\/schemas.microsoft.com\/xrm\/2011\/Contracts","Value":597910001}},{"key":"coe_environmentcreationrequestid","value":"bab008f4-ec00-ec11-94ef-000d3a4a0631"},{"key":"modifiedon","value":"\/Date(1629443841000)\/"},{"key":"modifiedby","value":{"__type":"EntityReference:http:\/\/schemas.microsoft.com\/xrm\/2011\/Contracts","Id":"0e7bd821-9efa-eb11-94ef-000d3abe1c35","KeyAttributes":[],"LogicalName":"systemuser","Name":null,"RowVersion":null}},{"key":"modifiedonbehalfby","value":null}],"EntityState":null,"FormattedValues":[],"Id":"bab008f4-ec00-ec11-94ef-000d3a4a0631","KeyAttributes":[],"LogicalName":"coe_environmentcreationrequest","RelatedEntities":[],"RowVersion":"7115886"}}],"IsExecutingOffline":false,"IsInTransaction":false,"IsOfflinePlayback":false,"IsolationMode":1,"MessageName":"Update","Mode":1,"OperationCreatedOn":"\/Date(1629443841000+0000)\/","OperationId":"6b2331a3-8601-ec11-94ef-000d3a4a0631","OrganizationId":"5c09f16a-5a66-4b5f-9524-d18e5d53fbe0","OrganizationName":"unq5c09f16a5a664b5f9524d18e5d53f","OutputParameters":[],"OwningExtension":{"Id":"3e663b03-d600-ec11-94ef-000d3a4a0631","KeyAttributes":[],"LogicalName":"sdkmessageprocessingstep","Name":null,"RowVersion":null},"ParentContext":{"BusinessUnitId":"933d2689-83db-eb11-bacb-000d3abfc550","CorrelationId":"cf09686a-884e-4407-a6e7-1ab2ec9dd25b","Depth":1,"InitiatingUserAzureActiveDirectoryObjectId":"00000000-0000-0000-0000-000000000000","InitiatingUserId":"0e7bd821-9efa-eb11-94ef-000d3abe1c35","InputParameters":[{"key":"Target","value":{"__type":"Entity:http:\/\/schemas.microsoft.com\/xrm\/2011\/Contracts","Attributes":[{"key":"coe_requeststatus","value":{"__type":"OptionSetValue:http:\/\/schemas.microsoft.com\/xrm\/2011\/Contracts","Value":597910001}},{"key":"coe_environmentcreationrequestid","value":"bab008f4-ec00-ec11-94ef-000d3a4a0631"}],"EntityState":null,"FormattedValues":[],"Id":"bab008f4-ec00-ec11-94ef-000d3a4a0631","KeyAttributes":[],"LogicalName":"coe_environmentcreationrequest","RelatedEntities":[],"RowVersion":null}},{"key":"x-ms-app-name","value":"admin_PowerPlatformAdminView"},{"key":"SuppressDuplicateDetection","value":false}],"IsExecutingOffline":false,"IsInTransaction":false,"IsOfflinePlayback":false,"IsolationMode":1,"MessageName":"Update","Mode":1,"OperationCreatedOn":"\/Date(1629443841000+0000)\/","OperationId":"6b2331a3-8601-ec11-94ef-000d3a4a0631","OrganizationId":"5c09f16a-5a66-4b5f-9524-d18e5d53fbe0","OrganizationName":"unq5c09f16a5a664b5f9524d18e5d53f","OutputParameters":[],"OwningExtension":{"Id":"3e663b03-d600-ec11-94ef-000d3a4a0631","KeyAttributes":[],"LogicalName":"sdkmessageprocessingstep","Name":null,"RowVersion":null},"ParentContext":null,"PostEntityImages":[],"PreEntityImages":[],"PrimaryEntityId":"bab008f4-ec00-ec11-94ef-000d3a4a0631","PrimaryEntityName":"coe_environmentcreationrequest","RequestId":"b1ab57c0-9e3c-4ce0-9c5b-d1b2a96168df","SecondaryEntityName":"none","SharedVariables":[{"key":"IsAutoTransact","value":true},{"key":"x-ms-app-name","value":"admin_PowerPlatformAdminView"}],"Stage":30,"UserAzureActiveDirectoryObjectId":"00000000-0000-0000-0000-000000000000","UserId":"0e7bd821-9efa-eb11-94ef-000d3abe1c35"},"PostEntityImages":[{"key":"AsynchronousStepPrimaryName","value":{"Attributes":[{"key":"coe_name","value":"3"},{"key":"coe_environmentcreationrequestid","value":"bab008f4-ec00-ec11-94ef-000d3a4a0631"}],"EntityState":null,"FormattedValues":[],"Id":"bab008f4-ec00-ec11-94ef-000d3a4a0631","KeyAttributes":[],"LogicalName":"coe_environmentcreationrequest","RelatedEntities":[],"RowVersion":null}}],"PreEntityImages":[{"key":"PostImage","value":{"Attributes":[{"key":"coe_envdisplayname","value":"testyy"},{"key":"coe_envregion","value":"tadf"},{"key":"coe_hasdatabase","value":false}],"EntityState":null,"FormattedValues":[{"key":"coe_hasdatabase","value":"No"}],"Id":"bab008f4-ec00-ec11-94ef-000d3a4a0631","KeyAttributes":[],"LogicalName":"coe_environmentcreationrequest","RelatedEntities":[],"RowVersion":null}}],"PrimaryEntityId":"bab008f4-ec00-ec11-94ef-000d3a4a0631","PrimaryEntityName":"coe_environmentcreationrequest","RequestId":"b1ab57c0-9e3c-4ce0-9c5b-d1b2a96168df","SecondaryEntityName":"none","SharedVariables":[{"key":"IsAutoTransact","value":true},{"key":"x-ms-app-name","value":"admin_PowerPlatformAdminView"}],"Stage":40,"UserAzureActiveDirectoryObjectId":"00000000-0000-0000-0000-000000000000","UserId":"0e7bd821-9efa-eb11-94ef-000d3abe1c35"}

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (1,201)