Reputation: 163
I am trying to perform json -> json transformation using the logic app. below is the logic app code. transformation is not working as expected. not sure what is the problem. I have tested the templated in the online liquid sandbox, where I didn't see any problem.
{
"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"
}
}
}
}
Template:
{
"name" : "{{firstName}} {{lastName}}"
}
Input:
{
"firstName": "Jack",
"LastName": "Jill"
}
Expected Output:
{
"name" : "Jack Jill"
}
Actual output from Logic App:
{
"name": " "
}
Upvotes: 0
Views: 1946
Reputation: 31
Just adding Anju's reply:
There's a really simple way Azure Logic App - Issue with double quotes in Liquid Map to work around the issue with double qoutes :
"quotedText":'{{ fieldThatContainsDoubleQuotes }}'
Upvotes: 0
Reputation: 1
Liquid Transformation is advanced version of JSON Transformation. It should be used in complex JSON scenario. In case you have simple JSON, then Compose or Parse JSON should be used.
Reason: Liquid transformation fails when data string has special character double quote. So, to avoid action transformation fails, use Compose or Parse JSON.
Upvotes: 0
Reputation: 163
this worked with below template
{
"name" : "{{content.firstName}} {{content.lastName}}"
}
Upvotes: 1