Freigeben über


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.

  1. Go to your Integration Account's overview blade and click on Maps.
  2. 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:

  1. JSON to JSON
    • Map (AddressMap.liquid)
      {
      "name": "{{content.name}}",
      "address": "{{content.streetAddress | Append: ', ' | Append: content.city | Append: ', ' | Append: content.state | Append: '.'}}"
      }
    • Action inputs
    • Output
  2. JSON to Text
    • Map ( SimpleJsonToText.liquid )
      {{content.firstName | Append: ' ' | Append: content.lastName}}
    • Action inputs
    • Output
  3. XML to JSON
    • Map ( ProductXmlToJson.liquid )
      {
      "name": "{{content.product.name}}",
      "price": {{content.product.price}},
      "transactionReferenceNumber": {{content.product.transactionReferenceNumber}}
      }
    • Action inputs
    • Output
  4. XML to Text
    • Map ( FullNameXmlToText.liquid )
      {{content.student.firstName | Append: ' ' | Append: content.student.lastName}}
    • Action inputs
    • Output

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
    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?