I have a Cloud Flow with a ‘Response’ action, illustrated below:

I call the flow from my Canvas App and store the response in the ‘KustoResponse‘ context variable using the following PowerFx formula.

While testing the Canvas App, even though the flow ran successfully, flow’s response was not being captured in ‘KustoResponse‘ variable. When inspected, I noticed ‘ConstraintViolated’ error at the ‘KustoResponse‘ variable.

Reason and Fix:

  • Issue was due to the mismatch between the Response actions ‘Body’ and ‘Response Body JSON Schema’.
  • There was a change in the schema structure of my API response, which I did not refresh the ‘Response Body JSON Schema’ field.
  • “Due to the mismatch, when the flow is called from the Canvas app, the ‘KustoResponse‘ variable displays the ‘ConstraintViolated’ error.
  • This error was annoying because the flow would run successfully when called from the Canvas app but the ‘KustoResponse‘ variable failed to capture the response.
  • Update the flow’s Response > ‘Response Body JSON Schema’ with the latest schema will fix the issue.

🙂

Advertisements
Advertisements

Leave a comment