I have created a logic app to receive an http request and validate the content which is fine. But when I receive the 400 error message, it said only that it was expecting an integer but received a string for example. I would like to add the name of the field that generates the error is it possible?
I added an http response to be executed when the requst fails but it's never triggered.
logic flow
CodePudding user response:
You can assign http response to a variable and then you can check which filed is causing error. I have reproduced issue from my side and below are steps I followed,
- Initially created logic app as shown below,
- Payload of http trigger is, Logic app trigger is enabled with schema validation,
- I have tried to run trigger with below payload,
{
"number":1600,
"street_name":"pennsylvania",
"street_type":7
}
Got error "Failed to start a run of logic app alertschlapp. The input body for trigger 'manual' of type 'Request' did not match its schema definition. Error details: 'Invalid type. Expected String but got Integer.'."
- Next modified logic app as shown below,
- Added three initialize variables action for number, street_name and street_type number: street_name: street_type:
- Ran the logic app with below payload,
"number":1600,
"street_name":"pennsylvania",
"street_type":7
- Logic app failed with below error, In this way, you can find out which field value is causing issue.