cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LauM
Helper I
Helper I

PARSE JSON schema validation failed when I add records

Hi,

I created a flow earlier this week that worked. I wanted to run it again today but it failed even though I made no changes.

The steps are:

  1. List records
  2. Compose (JSON)
  3. Parse JSON
  4. Create CSV Table

I noticed something strange: when I check the error on the Parse JSON, I then copy the Outputs data of the previous step 'Compose JSON', then I paste it into the Output the Parse JSON, then save and run it and it works. So it is OK.

But, when I add a new record thanks to my model-driven app, I run again my flow and then my flow fails into the same step! I add to copy again the Compose JSON into the parse JSON so the flow can succeed...

I don't understand anything. Can someone help me on this?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User III
Super User III

Hi @LauM

 

Yes you can remove the fields which not expecting in the schema. Adding optional is another option to solve your issue.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

9 REPLIES 9
abm
Super User III
Super User III

Hi @LauM 

 

Most likely you are not using the exact schema every time. So when you generate originally some of the strings or integer values are present hence it automatically becomes mandatory. Looks like your second run you may have missing this from the data hence you getting Schema validation error.  If you data is not consistent then edit your JSON to remove the mandatory options.

 

If you receive the error again please post the details of the error what you getting.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
LauM
Helper I
Helper I

I found the origin of this error: I added a new record without selecting a value for an option set field (or choice now). So, when I let the field (optional field) empty (he didn't get any default value), the parse json sends an error.

Is there any solution to avoid this error?

Or the only solution is to put a default value for the field?

Hi @abm ,

the Parse JSON is in error when I let some optional fields empty in my model-driven form (and not only with choices, like I thought).

How can I handle that? Because I want to let some fields empty in some cases.

abm
Super User III
Super User III

Hi @LauM 

 

Check your generated schema contains the relevant optionset set as required? If so remove this from the schema and try.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
abm
Super User III
Super User III

Hi @LauM 

 

Also if your option set field is optional could you pass as null then set in your schema to accept null as well. Please see below.

 

"YourOptionSetFieldName":{
"type": [ "number", "null"]
}



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

Hi @abm ,

 

I modified the JSON schema as you explained (see the crceb_resultat field below) but all the fields seem to be required at the end of the Schema.

How can I put them optional?

There are some fields required, but I manage this in my form, and the same way for optional fields.

 

Here is the schema:

{
    "type""array",
    "items": {
        "type""object",
        "properties": {
            "@@odata.type": {
                "type""string"
            },
            "@@odata.id": {
                "type""string"
            },
            "@@odata.etag": {
                "type""string"
            },
            "@@odata.editLink": {
                "type""string"
            },
            "crceb_misekellycriterion@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_misekellycriterion@odata.type": {
                "type""string"
            },
            "crceb_misekellycriterion": {
                "type""number"
            },
            "statecode@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "statecode": {
                "type""integer"
            },
            "crceb_estimationprobabilite@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_estimationprobabilite@odata.type": {
                "type""string"
            },
            "crceb_estimationprobabilite": {
                "type""integer"
            },
            "statuscode@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "statuscode": {
                "type""integer"
            },
            "crceb_resultat@OData.Community.Display.V1.FormattedValue": {
                "type": [
                    "string",
                    "null"
                ]
            },
            "crceb_resultat": {
                "type": [
                    "integer",
                    "null"
                ]
            },
            "crceb_deux@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_deux@odata.type": {
                "type""string"
            },
            "crceb_deux": {
                "type""integer"
            },
            "crceb_commentaires": {
                "type""string"
            },
            "createdon@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "createdon@odata.type": {
                "type""string"
            },
            "createdon": {
                "type""string"
            },
            "crceb_betcote@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_betcote@odata.type": {
                "type""string"
            },
            "crceb_betcote": {
                "type""integer"
            },
            "importsequencenumber@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "importsequencenumber": {
                "type""integer"
            },
            "crceb_gain_base@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_gain_base@odata.type": {
                "type""string"
            },
            "crceb_gain_base": {
                "type""integer"
            },
            "crceb_bankrollmiseajour_base@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_bankrollmiseajour_base@odata.type": {
                "type""string"
            },
            "crceb_bankrollmiseajour_base": {
                "type""integer"
            },
            "exchangerate@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "exchangerate@odata.type": {
                "type""string"
            },
            "exchangerate": {
                "type""integer"
            },
            "crceb_pronostics@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_pronostics": {
                "type""integer"
            },
            "crceb_bet": {
                "type""string"
            },
            "crceb_misekellycriterion_base@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_misekellycriterion_base@odata.type": {
                "type""string"
            },
            "crceb_misekellycriterion_base": {
                "type""number"
            },
            "_ownerid_value@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "_ownerid_value@Microsoft.Dynamics.CRM.associatednavigationproperty": {
                "type""string"
            },
            "_ownerid_value@Microsoft.Dynamics.CRM.lookuplogicalname": {
                "type""string"
            },
            "_ownerid_value@odata.type": {
                "type""string"
            },
            "_ownerid_value": {
                "type""string"
            },
            "crceb_bankroll_base@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_bankroll_base@odata.type": {
                "type""string"
            },
            "crceb_bankroll_base": {
                "type""integer"
            },
            "modifiedon@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "modifiedon@odata.type": {
                "type""string"
            },
            "modifiedon": {
                "type""string"
            },
            "crceb_bankrollmiseajour@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_bankrollmiseajour@odata.type": {
                "type""string"
            },
            "crceb_bankrollmiseajour": {
                "type""integer"
            },
            "versionnumber@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "versionnumber@odata.type": {
                "type""string"
            },
            "versionnumber": {
                "type""integer"
            },
            "crceb_gaincashout_base@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_gaincashout_base@odata.type": {
                "type""string"
            },
            "crceb_gaincashout_base": {
                "type""integer"
            },
            "crceb_mise@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_mise@odata.type": {
                "type""string"
            },
            "crceb_mise": {
                "type""integer"
            },
            "crceb_benefice@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_benefice@odata.type": {
                "type""string"
            },
            "crceb_benefice": {
                "type""integer"
            },
            "crceb_unn@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_unn@odata.type": {
                "type""string"
            },
            "crceb_unn": {
                "type""integer"
            },
            "_transactioncurrencyid_value@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "_transactioncurrencyid_value@Microsoft.Dynamics.CRM.associatednavigationproperty": {
                "type""string"
            },
            "_transactioncurrencyid_value@Microsoft.Dynamics.CRM.lookuplogicalname": {
                "type""string"
            },
            "_transactioncurrencyid_value@odata.type": {
                "type""string"
            },
            "_transactioncurrencyid_value": {
                "type""string"
            },
            "crceb_ndeux@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_ndeux@odata.type": {
                "type""string"
            },
            "crceb_ndeux": {
                "type""integer"
            },
            "crceb_betid@odata.type": {
                "type""string"
            },
            "crceb_betid": {
                "type""string"
            },
            "crceb_un@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_un@odata.type": {
                "type""string"
            },
            "crceb_un": {
                "type""integer"
            },
            "crceb_benefice_base@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_benefice_base@odata.type": {
                "type""string"
            },
            "crceb_benefice_base": {
                "type""integer"
            },
            "_modifiedby_value@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "_modifiedby_value@Microsoft.Dynamics.CRM.lookuplogicalname": {
                "type""string"
            },
            "_modifiedby_value@odata.type": {
                "type""string"
            },
            "_modifiedby_value": {
                "type""string"
            },
            "crceb_kellycriterion@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_kellycriterion@odata.type": {
                "type""string"
            },
            "crceb_kellycriterion": {
                "type""number"
            },
            "crceb_bankroll@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_bankroll@odata.type": {
                "type""string"
            },
            "crceb_bankroll": {
                "type""integer"
            },
            "_owningbusinessunit_value@Microsoft.Dynamics.CRM.associatednavigationproperty": {
                "type""string"
            },
            "_owningbusinessunit_value@Microsoft.Dynamics.CRM.lookuplogicalname": {
                "type""string"
            },
            "_owningbusinessunit_value@odata.type": {
                "type""string"
            },
            "_owningbusinessunit_value": {
                "type""string"
            },
            "crceb_gain@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_gain@odata.type": {
                "type""string"
            },
            "crceb_gain": {
                "type""integer"
            },
            "crceb_n@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_n@odata.type": {
                "type""string"
            },
            "crceb_n": {
                "type""integer"
            },
            "_createdby_value@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "_createdby_value@Microsoft.Dynamics.CRM.lookuplogicalname": {
                "type""string"
            },
            "_createdby_value@odata.type": {
                "type""string"
            },
            "_createdby_value": {
                "type""string"
            },
            "crceb_gaincashout@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_gaincashout@odata.type": {
                "type""string"
            },
            "crceb_gaincashout": {
                "type""integer"
            },
            "crceb_ticketstatut@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_ticketstatut": {
                "type""integer"
            },
            "_owninguser_value@Microsoft.Dynamics.CRM.lookuplogicalname": {
                "type""string"
            },
            "_owninguser_value@odata.type": {
                "type""string"
            },
            "_owninguser_value": {
                "type""string"
            },
            "crceb_mise_base@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_mise_base@odata.type": {
                "type""string"
            },
            "crceb_mise_base": {
                "type""integer"
            },
            "_crceb_competition_value@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "_crceb_competition_value@Microsoft.Dynamics.CRM.associatednavigationproperty": {
                "type""string"
            },
            "_crceb_competition_value@Microsoft.Dynamics.CRM.lookuplogicalname": {
                "type""string"
            },
            "_crceb_competition_value@odata.type": {
                "type""string"
            },
            "_crceb_competition_value": {
                "type""string"
            },
            "crceb_typebet@OData.Community.Display.V1.FormattedValue": {
                "type""string"
            },
            "crceb_typebet": {
                "type""integer"
            },
            "ownerid@odata.associationLink": {
                "type""string"
            },
            "ownerid@odata.navigationLink": {
                "type""string"
            },
            "transactioncurrencyid@odata.associationLink": {
                "type""string"
            },
            "transactioncurrencyid@odata.navigationLink": {
                "type""string"
            },
            "owningbusinessunit@odata.associationLink": {
                "type""string"
            },
            "owningbusinessunit@odata.navigationLink": {
                "type""string"
            },
            "crceb_Competition@odata.associationLink": {
                "type""string"
            },
            "crceb_Competition@odata.navigationLink": {
                "type""string"
            },
            "createdby@odata.associationLink": {
                "type""string"
            },
            "createdby@odata.navigationLink": {
                "type""string"
            },
            "createdonbehalfby@odata.associationLink": {
                "type""string"
            },
            "createdonbehalfby@odata.navigationLink": {
                "type""string"
            },
            "modifiedby@odata.associationLink": {
                "type""string"
            },
            "modifiedby@odata.navigationLink": {
                "type""string"
            },
            "modifiedonbehalfby@odata.associationLink": {
                "type""string"
            },
            "modifiedonbehalfby@odata.navigationLink": {
                "type""string"
            },
            "owninguser@odata.associationLink": {
                "type""string"
            },
            "owninguser@odata.navigationLink": {
                "type""string"
            },
            "owningteam@odata.associationLink": {
                "type""string"
            },
            "owningteam@odata.navigationLink": {
                "type""string"
            },
            "crceb_bet_SyncErrors@odata.associationLink": {
                "type""string"
            },
            "crceb_bet_SyncErrors@odata.navigationLink": {
                "type""string"
            },
            "crceb_bet_DuplicateMatchingRecord@odata.associationLink": {
                "type""string"
            },
            "crceb_bet_DuplicateMatchingRecord@odata.navigationLink": {
                "type""string"
            },
            "crceb_bet_DuplicateBaseRecord@odata.associationLink": {
                "type""string"
            },
            "crceb_bet_DuplicateBaseRecord@odata.navigationLink": {
                "type""string"
            },
            "crceb_bet_AsyncOperations@odata.associationLink": {
                "type""string"
            },
            "crceb_bet_AsyncOperations@odata.navigationLink": {
                "type""string"
            },
            "crceb_bet_MailboxTrackingFolders@odata.associationLink": {
                "type""string"
            },
            "crceb_bet_MailboxTrackingFolders@odata.navigationLink": {
                "type""string"
            },
            "crceb_bet_UserEntityInstanceDatas@odata.associationLink": {
                "type""string"
            },
            "crceb_bet_UserEntityInstanceDatas@odata.navigationLink": {
                "type""string"
            },
            "crceb_bet_ProcessSession@odata.associationLink": {
                "type""string"
            },
            "crceb_bet_ProcessSession@odata.navigationLink": {
                "type""string"
            },
            "crceb_bet_BulkDeleteFailures@odata.associationLink": {
                "type""string"
            },
            "crceb_bet_BulkDeleteFailures@odata.navigationLink": {
                "type""string"
            },
            "crceb_bet_PrincipalObjectAttributeAccesses@odata.associationLink": {
                "type""string"
            },
            "crceb_bet_PrincipalObjectAttributeAccesses@odata.navigationLink": {
                "type""string"
            },
            "crceb_Bet_crceb_Bet_crceb_Game@odata.associationLink": {
                "type""string"
            },
            "crceb_Bet_crceb_Bet_crceb_Game@odata.navigationLink": {
                "type""string"
            }
        },
        "required": [
            "@@odata.type",
            "@@odata.id",
            "@@odata.etag",
            "@@odata.editLink",
            "statecode@OData.Community.Display.V1.FormattedValue",
            "statecode",
            "statuscode@OData.Community.Display.V1.FormattedValue",
            "statuscode",
            "crceb_resultat@OData.Community.Display.V1.FormattedValue",
            "crceb_resultat",
            "createdon@OData.Community.Display.V1.FormattedValue",
            "createdon@odata.type",
            "createdon",
            "exchangerate@OData.Community.Display.V1.FormattedValue",
            "exchangerate@odata.type",
            "exchangerate",
            "crceb_pronostics@OData.Community.Display.V1.FormattedValue",
            "crceb_pronostics",
            "crceb_bet",
            "_ownerid_value@OData.Community.Display.V1.FormattedValue",
            "_ownerid_value@Microsoft.Dynamics.CRM.associatednavigationproperty",
            "_ownerid_value@Microsoft.Dynamics.CRM.lookuplogicalname",
            "_ownerid_value@odata.type",
            "_ownerid_value",
            "modifiedon@OData.Community.Display.V1.FormattedValue",
            "modifiedon@odata.type",
            "modifiedon",
            "versionnumber@OData.Community.Display.V1.FormattedValue",
            "versionnumber@odata.type",
            "versionnumber",
            "_transactioncurrencyid_value@OData.Community.Display.V1.FormattedValue",
            "_transactioncurrencyid_value@Microsoft.Dynamics.CRM.associatednavigationproperty",
            "_transactioncurrencyid_value@Microsoft.Dynamics.CRM.lookuplogicalname",
            "_transactioncurrencyid_value@odata.type",
            "_transactioncurrencyid_value",
            "crceb_betid@odata.type",
            "crceb_betid",
            "_modifiedby_value@OData.Community.Display.V1.FormattedValue",
            "_modifiedby_value@Microsoft.Dynamics.CRM.lookuplogicalname",
            "_modifiedby_value@odata.type",
            "_modifiedby_value",
            "_owningbusinessunit_value@Microsoft.Dynamics.CRM.associatednavigationproperty",
            "_owningbusinessunit_value@Microsoft.Dynamics.CRM.lookuplogicalname",
            "_owningbusinessunit_value@odata.type",
            "_owningbusinessunit_value",
            "_createdby_value@OData.Community.Display.V1.FormattedValue",
            "_createdby_value@Microsoft.Dynamics.CRM.lookuplogicalname",
            "_createdby_value@odata.type",
            "_createdby_value",
            "crceb_ticketstatut@OData.Community.Display.V1.FormattedValue",
            "crceb_ticketstatut",
            "_owninguser_value@Microsoft.Dynamics.CRM.lookuplogicalname",
            "_owninguser_value@odata.type",
            "_owninguser_value",
            "crceb_typebet@OData.Community.Display.V1.FormattedValue",
            "crceb_typebet",
            "ownerid@odata.associationLink",
            "ownerid@odata.navigationLink",
            "transactioncurrencyid@odata.associationLink",
            "transactioncurrencyid@odata.navigationLink",
            "owningbusinessunit@odata.associationLink",
            "owningbusinessunit@odata.navigationLink",
            "crceb_Competition@odata.associationLink",
            "crceb_Competition@odata.navigationLink",
            "createdby@odata.associationLink",
            "createdby@odata.navigationLink",
            "createdonbehalfby@odata.associationLink",
            "createdonbehalfby@odata.navigationLink",
            "modifiedby@odata.associationLink",
            "modifiedby@odata.navigationLink",
            "modifiedonbehalfby@odata.associationLink",
            "modifiedonbehalfby@odata.navigationLink",
            "owninguser@odata.associationLink",
            "owninguser@odata.navigationLink",
            "owningteam@odata.associationLink",
            "owningteam@odata.navigationLink",
            "crceb_bet_SyncErrors@odata.associationLink",
            "crceb_bet_SyncErrors@odata.navigationLink",
            "crceb_bet_DuplicateMatchingRecord@odata.associationLink",
            "crceb_bet_DuplicateMatchingRecord@odata.navigationLink",
            "crceb_bet_DuplicateBaseRecord@odata.associationLink",
            "crceb_bet_DuplicateBaseRecord@odata.navigationLink",
            "crceb_bet_AsyncOperations@odata.associationLink",
            "crceb_bet_AsyncOperations@odata.navigationLink",
            "crceb_bet_MailboxTrackingFolders@odata.associationLink",
            "crceb_bet_MailboxTrackingFolders@odata.navigationLink",
            "crceb_bet_UserEntityInstanceDatas@odata.associationLink",
            "crceb_bet_UserEntityInstanceDatas@odata.navigationLink",
            "crceb_bet_ProcessSession@odata.associationLink",
            "crceb_bet_ProcessSession@odata.navigationLink",
            "crceb_bet_BulkDeleteFailures@odata.associationLink",
            "crceb_bet_BulkDeleteFailures@odata.navigationLink",
            "crceb_bet_PrincipalObjectAttributeAccesses@odata.associationLink",
            "crceb_bet_PrincipalObjectAttributeAccesses@odata.navigationLink",
            "crceb_Bet_crceb_Bet_crceb_Game@odata.associationLink",
            "crceb_Bet_crceb_Bet_crceb_Game@odata.navigationLink"
        ]
    }
}
LauM
Helper I
Helper I

Hi @abm,

 

I simply put "optional" instead of "required" at the end of the schema, and then it solved my issues.

Do you think I can removed the fields I don't want and need in the JSON schema without putting new errors?

abm
Super User III
Super User III

Hi @LauM

 

Yes you can remove the fields which not expecting in the schema. Adding optional is another option to solve your issue.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

abm
Super User III
Super User III

Hi @LauM 

 

From the required section remove the fields which are optional.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (74,642)