Logic app Liquid XML to JSON fails with empty result
Describe the Bug with repro steps
- upload array.liquid with this content to integration account:
{% assign firstname = content.root.name[0] %} { "message": "Hi, how are you {{firstname}} ?" }
or
{ "message": "Hi, how are you {{content.root.name[0]}}?" }
-
create logic app : with http and xml to json transformer and use @triggerBody() from When_a_HTTP_request_is_received as input.
-
run with this content: tpye application/xml and payload:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<name>Foo</name>
<name>Bar</name>
</root>
expected result:
{ "message": "Hi, how are you Foo ?" }
actual result:
{ "message": "Hi, how are you ?"}
What type of Logic App Is this happening in?
Consumption (Portal)
Are you using new designer or old designer
New Designer
Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg
Yes
Workflow JSON
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"contentVersion": "1.0.0.0",
"triggers": {
"When_a_HTTP_request_is_received": {
"type": "Request",
"kind": "Http"
}
},
"actions": {
"Transform_XML_To_JSON": {
"type": "Liquid",
"kind": "XmlToJson",
"inputs": {
"content": "@triggerBody()",
"integrationAccount": {
"map": {
"name": "array"
}
}
},
"runAfter": {}
}
},
"outputs": {},
"parameters": {
"$connections": {
"type": "Object",
"defaultValue": {}
}
}
},
"parameters": {
"$connections": {
"value": {}
}
}
}
Screenshots or Videos
No response
Browser
Firefox
Additional context
client tracking id: 08584884372708382509795379022CU05
action tracking id: 861917f0-740f-4fbe-8431-afa00bc04bca
4/15/2024, 8:46:09 AM
AB#27663887
If the liquid code is changed to output {{content.root.name}} it just prints the first element "Foo", which is also wrong as the Ruby implementation of Liquid outputs "FooBar". So there is no way of getting to the second instance of "name", is there?
Passing this over to the backend issues and I’ll ping an engineer who can take a look.
This issue is stale because it has been open for 45 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.