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
Super User

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
Super User

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

@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
Super User

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
Super User

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 Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (2,346)