Share via


The template language function 'xml' parameter is not valid

Question

Friday, December 27, 2019 2:40 AM

Hi,

I tried creating a logic app design to convert an xml doc in blob storage to a json doc in the same blob storage, I got the error below

InvalidTemplate. Unable to process template language expressions in action 'Create_blob' inputs at line '1' and column '3066': 'The template language function 'xml' parameter is not valid. The provided value cannot be converted to XML: 'JSON root object has multiple properties. The root object must have a single property in order to create a valid XML document. Consider specifying a DeserializeRootElementName. Path 'outputs.body.Name'.'. Please see https://aka.ms/logicexpressions#xml for usage details.'.

 

I'll appreciate some help with this issue.

All replies (10)

Friday, December 27, 2019 6:30 AM

Could you share the exact expression that you are trying?

Note that the xml function is to convert to XML. You have to use the json function to convert to JSON.


Friday, December 27, 2019 5:03 PM

I tried both json(triggerBody()) and json(xml(triggerBody())).


Tuesday, December 31, 2019 12:49 PM

Could you share a screenshot of your logic app? And also the payload if possible?


Tuesday, December 31, 2019 4:41 PM

Hi,

Can I get your email address so I can send it, for some reason I am unable to send the link I used or the screenshot.

Thanks


Wednesday, January 1, 2020 7:47 AM

Sure. Feel free to send an email to azcommunity[at]microsoft[dot]com with the URL of this thread and we can work one on one to investigate further.


Thursday, January 2, 2020 4:30 PM

Sent




Thursday, January 2, 2020 4:31 PM

I used this link

https://blogs.msdn.microsoft.com/mioteg/2017/07/06/converting-xml-to-json-with-azure-logic-apps/


Monday, January 6, 2020 1:57 PM

Hi,

Any update?

The expression isn't working.


Monday, January 6, 2020 2:29 PM

Based on the screenshot that you've shared over email, the blob trigger that you are using only returns metadata of the blob that was added or modified. As mentioned in the docs, you will have to use the Get blob content action to fetch the content after which you should be able to use the expression.


Wednesday, January 8, 2020 6:27 AM