Introducing the Liquid connector - transform JSON to JSON, JSON to Text, XML to JSON and XML to Text
We have recently added the Liquid connector to Logic Apps which provides four transform actions. These actions use maps, which are written using Liquid Template Language, to transform the data. Following are the four transforms available:
To use the liquid connector, the logic app must be associated with an Integration Account and the transform maps must be uploaded to that Integration Account. You can configure Integration Account in the Workflow Settings as shown below .
Here's how you can upload a liquid map to an Integration Account. Make sure you select liquid in the Map type dropdown.
- Go to your Integration Account's overview blade and click on Maps.
- Click on Add. Provide a name for the map, select liquid for Map type and upload the map file.
Here are few examples to demonstrate each of the actions:
JSON to JSON
- Map (AddressMap.liquid)
{
"name": "{{content.name}}",
"address": "{{content.streetAddress | Append: ', ' | Append: content.city | Append: ', ' | Append: content.state | Append: '.'}}"
} - Action inputs
- Output
- Map (AddressMap.liquid)
JSON to Text
- Map ( SimpleJsonToText.liquid )
{{content.firstName | Append: ' ' | Append: content.lastName}} - Action inputs
- Output
- Map ( SimpleJsonToText.liquid )
XML to JSON
- Map ( ProductXmlToJson.liquid )
{
"name": "{{content.product.name}}",
"price": {{content.product.price}},
"transactionReferenceNumber": {{content.product.transactionReferenceNumber}}
} - Action inputs
- Output
- Map ( ProductXmlToJson.liquid )
XML to Text
- Map ( FullNameXmlToText.liquid )
{{content.student.firstName | Append: ' ' | Append: content.student.lastName}} - Action inputs
- Output
- Map ( FullNameXmlToText.liquid )
Detailed documentation is available here: /en-us/azure/logic-apps/logic-apps-enterprise-integration-liquid-transform
Comments
- Anonymous
December 08, 2017
It is unfortunate that we have to have an Enterprise Account to use this feature as that is quite a lot of additional cost (even with the new Basic SKU). It is tempting to avoid the cost by creating a Function that has parameters for the map location (in Blob storage) and the input content. The Function would use Dotliquid to do the transformation and return the results.I would rather not be forced into these less optimal solutions, what is the justification for charging for the Enterprise Account when it appears (in this scenario) to be little more than a repository for the maps?- Anonymous
December 08, 2017
Hi Jason, as you can see, this case, integration account not only holds the map, but also powers the back-end that does the actual transform.Azure Functions is an option, but keep in mind that Function's consumption plan do not have any SLA guarantee, has a warm up time, and require custom code that you will have to develop, deploy, and maintain.Hope this helps.- Anonymous
December 12, 2017
These are good points Derek, but I would rather see the mapping Actions charged on a Consumption model (preferably at the Standard Connector rate, but I would understand if it were a bit higher).I am not alone in this belief: https://toonvanhoutte.wordpress.com/2017/12/11/my-two-cents-on-the-logic-apps-pricing-model/
- Anonymous
- Anonymous
- Anonymous
September 11, 2018
Hi,I was able to get valid output from XML to JSON conversion, but can’t use that as input to store it e.g. to blob - what I’m missing?BR,Mika- Anonymous
September 19, 2018
Hi Mika,Can you elaborate more on what exact issue you are facing while using the output of the liquid action as the input of any other action?
- Anonymous