液体模板转换在Azure Logic app中不起作用
我正在尝试使用logic应用程序执行json->json转换。下面是逻辑应用程序代码。转换未按预期工作。不知道是什么问题。我已经在在线液体沙盒中测试了模板,在那里我没有发现任何问题液体模板转换在Azure Logic app中不起作用,azure,azure-logic-apps,dotliquid,liquid-template,Azure,Azure Logic Apps,Dotliquid,Liquid Template,我正在尝试使用logic应用程序执行json->json转换。下面是逻辑应用程序代码。转换未按预期工作。不知道是什么问题。我已经在在线液体沙盒中测试了模板,在那里我没有发现任何问题 { "definition": { "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Response": {
"inputs": {
"body": "@body('Transform_JSON_to_JSON')",
"statusCode": 200
},
"kind": "Http",
"runAfter": {
"Transform_JSON_to_JSON": [
"Succeeded"
]
},
"type": "Response"
},
"Transform_JSON_to_JSON": {
"inputs": {
"content": "@triggerBody()",
"integrationAccount": {
"map": {
"name": "lqd"
}
}
},
"kind": "JsonToJson",
"runAfter": {},
"type": "Liquid"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {},
"triggers": {
"manual": {
"inputs": {
"schema": {}
},
"kind": "Http",
"type": "Request"
}
}
}
}
模板:
{
"name" : "{{firstName}} {{lastName}}"
}
输入:
{
"firstName": "Jack",
"LastName": "Jill"
}
预期产出:
{
"name" : "Jack Jill"
}
逻辑应用程序的实际输出:
{
"name": " "
}
这与下面的模板一起工作
{
"name" : "{{content.firstName}} {{content.lastName}}"
}
Liquid Transformation是JSON转换的高级版本。它应该在复杂的JSON场景中使用。如果您有简单的JSON,那么应该使用Compose或Parse JSON 原因:当数据字符串具有特殊字符双引号时,液体转换失败。因此,为了避免操作转换失败,请使用Compose或Parse JSON