Logo

dev-resources.site

for different kinds of informations.

Liquid template in Logic App

Published at
5/6/2022
Categories
azure
logicapps
liquid
Author
leonards
Categories
3 categories in total
azure
open
logicapps
open
liquid
open
Author
8 person written this
leonards
open
Liquid template in Logic App

I was testing out Shopify liquid template to perform XML to XML/JSON data transformation. Liquid template is one of the templating tool mentioned in Microsoft's website to perform data transformation in Logic App (the other tool being the venerable XSLT).

I've not used XSLT before, but comparing to liquid template, the latter seems more friendly. As such, I embarked on using liquid template for my research.

Below are the 2 observations I found, and the workaround I need to do to fulfill the task on hand.

  1. Syntax differences between liquid and dotliquid (used by Microsoft):
    a. Capitalisation of first letter, i.e. Append instead of append.
    b. Different naming, i.e. DividedBy instead of divided_by

    The problem for syntax differences is that there's no error. The script just run successfully, but the filter functions are not executed ๐Ÿ™„.

  2. Unable to differentiate single child node vs. list of child nodes. To give an example, below are 2 valid snippets that can be interpreted differently.

    Snippet 1

    <order>
        <orderItem>
            <itemName>Item 1</itemName>
        </orderItem>
    </order>
    

    Snippet 2

    <order>
        <orderItem>
            <itemName>Item 1</itemName>
        </orderItem>
        <orderItem>
            <itemName>Item 2</itemName>
        </orderItem>
    </order>
    

    The first snippet interprets order as an object containing orderItem. On the other hand, the second snippet interprets order as an _array _of `orderItem ๐Ÿ˜…

    Fortunately, Microsoft has JSONArrayFor. Using JSONArrayFor instead of For loop, we're able to force order to be treated as an array regardless of the number of orderItem insider order.

logicapps Article's
30 articles in total
Favicon
TOP 5 Brain-Boosting Logic Games for Your Phone
Favicon
Security-First Architecture in Azure Logic Apps: Patterns, Practices, and Compliance
Favicon
Serverless Integration: Automate Your Workflow with Logic App
Favicon
Usando PAM no Linux
Favicon
Understanding the Differences between Overriding and Overloading in C#
Favicon
Add Parameters for Workflow Input in Azure Logic Apps
Favicon
AmP Credit Loan Cust0mer CareยฎHelpline Number-8102301568-@7061107023All problem Solhcf.
Favicon
Dynamically Parse JSON as Object or Array
Favicon
Updates to the Azure Onboarding App
Favicon
Automated Onboarding Azure Project
Favicon
Azure Logic Apps: Orchestrating Workflows with Zero Code Complexity" ๐ŸŒ๐Ÿ”ง[5/8]
Favicon
Azure Automated Onboarding Project
Favicon
Real-World Use Cases and Examples of Azure Logic Apps in Action
Favicon
Automate document processing with Form Recognizer and Logic Apps (Part 2)
Favicon
Automate document processing with Form Recognizer and Logic Apps (Part 1)
Favicon
Configuring Azure Logic App Failure Alerts To Stay Ahead
Favicon
Disabling Highly Privileged Azure AD Users with Azure Logic Apps and Microsoft Graph API
Favicon
Power Automate vs Azure Logic Apps
Favicon
How to edit a JSON object inside an Azure Logic App
Favicon
How to solve a DSA problem
Favicon
Using Logic Apps in Power Automate
Favicon
Quickly provision Logic App environment to start developing the flow
Favicon
Why you probably shouldn't use Logic Apps for enterprise integrations
Favicon
f-of-xstate: run some logic on your logic
Favicon
No-code Automation for Azure Boards Using Azure Logic Apps, Power Automate, and Power Virtual Agents
Favicon
Deploy Azure Logic Apps as code
Favicon
For loop with liquid template in Azure LogicApp
Favicon
Liquid template in Logic App
Favicon
Get Logic App Workflow using REST API (Postman)
Favicon
Parameterising Logic App (Standard) connections.json with bicep - Part 3

Featured ones: