'Liquid - How do I setup liquid template locally
How do I set up Liquid Templates locally? Suppose, I have this liquid template and I want to run this locally.
{%- assign deviceList = content.devices | Split: ', ' -%}
{
"fullName": "{{content.firstName | Append: ' ' | Append: content.lastName}}",
"firstNameUpperCase": "{{content.firstName | Upcase}}",
"phoneAreaCode": "{{content.phone | Slice: 1, 3}}",
"devices" : [
{%- for device in deviceList -%}
{%- if forloop.Last == true -%}
"{{device}}"
{%- else -%}
"{{device}}",
{%- endif -%}
{%- endfor -%}
]
}
Is it even possible?
Solution 1:[1]
Logic Apps uses the DotLiquid implementation for working with liquid templates which has a couple of differences from the original implementation, specifically the filter and output casing.
Unfortunately, I couldn't find a tool (like a CLI) which is built around dotliquid but there is one for with the original ruby implementation - liquid-cli - which I was able to use to test liquid templates locally.
To get the CLI to work, you would have to use the ruby casing (snake_case) instead of the C# naming conventions (PascalCase) for it to work and then change it back when using it in logic apps.
Solution 2:[2]
I just started as well and at the beginning I was using https://github.com/skastberg/LiquidTransformation which was ok for basic stuff but had some issues if some filters/tags.
But in the end i just created a logic app to test and a free integration account.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | PramodValavala-MSFT |
Solution 2 | FEST |