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:
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?
Solved! Go to Solution.
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.
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.
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.
"type": [ "number", "null"]
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:
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?
Check out the new Process Advisor community forum board!
Check out new user group experience and if you are a leader please create your group
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.
Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.