0
votes

Passing a valid JSON Message to the @xml() function works but the output seems to be somehow serialized. Is there a reference how to use the @xml() function or does anybody know what i'm doing wrong?

Expression in Data Operations - Compose Function (where 'Add_Root_Element' is the previous Function Block):

"inputs": {
    "xml": "@xml(outputs('Add_Root_Element'))"
}

Generated Output:

{
  "xml": {
    "$content-type": "application/xml;charset=utf-8",
    "$content": "PHJvb3Q+PHBhcnRpY2lwYW50Pjxjb3VudHJ5PkF1c3RyYWxpYTwvY291bnRyeT48ZGVwYXJ0bWVudD5JbmZvcm1hdGlvbiBUZWN...
  }
}

This question relates to the following question: Azure Logic App - JSON to XML Conversion

1

1 Answers

1
votes

The xml function returns a Base 64 string, if you take that $content value and transforms from Base 64 to string, you will obtain the generated XML.

A simple proof of concept is generate an HTTP Request - Response Logic App, that receives a JSON and in the output you assign to de body @xml(triggerBody()).

When you call, you will see in the output the XML representation of your input.