I’ve done some work with Logic Apps recently and got hung up on using the XML Validation. I started with a great Azure quickstart titled 201-logic-app-veter-pipeline that creates the following elements in the Logic App designer.
This works swimmingly when the xml is valid, however, when the xml does not conform to the xsd specified in the attached integration account, it makes the whole process fail. This likely works as intended but I’d like to log this failure to an external system and control the message back to the user.
There are two keys to making this work correctly,
- Making sure the condition runs on “Failed, Succeeded” by pressing the ellipse on the condition box and selecting “Configure run after”
- Add the following action in the conditional: actions(‘XML_Validation’).status ‘is equal to’ ‘Succeeded’
It should look something like this after you are finished.
You’ll have full access to the output of the XML_Validation’s output on and could potentially log something like actions(‘XML_Validation’)[‘outputs’][‘errors’] or just the Body of the XML Validation block.
I hope you find this useful.