You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/logic-apps/logic-apps-enterprise-integration-liquid-transform.md
+35-47Lines changed: 35 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,29 +7,18 @@ author: divyaswarnkar
7
7
ms.author: divswa
8
8
ms.reviewer: estfan, logicappspm
9
9
ms.topic: article
10
-
ms.date: 08/16/2018
10
+
ms.date: 04/01/2020
11
11
---
12
12
13
13
# Perform advanced JSON transformations with Liquid templates in Azure Logic Apps
14
14
15
-
You can perform basic JSON transformations in your logic apps with
16
-
native data operation actions such as **Compose** or **Parse JSON**.
17
-
To perform advanced JSON transformations, you can create templates
18
-
or maps with [Liquid](https://shopify.github.io/liquid/), which is
19
-
an open-source template language for flexible web apps. A Liquid template
20
-
defines how to transform JSON output and supports more complex JSON
21
-
transformations, such as iterations, control flows, variables, and so on.
15
+
You can perform basic JSON transformations in your logic apps with native data operation actions such as **Compose** or **Parse JSON**. To perform advanced JSON transformations, you can create templates or maps with [Liquid](https://shopify.github.io/liquid/), which is an open-source template language for flexible web apps. A Liquid template defines how to transform JSON output and supports more complex JSON transformations, such as iterations, control flows, variables, and so on.
22
16
23
-
Before you can perform a Liquid transformation in your logic app,
24
-
you must first define the JSON to JSON mapping with a Liquid template
25
-
and store that map in your integration account. This article shows
26
-
you how to create and use this Liquid template or map.
17
+
Before you can perform a Liquid transformation in your logic app, you must first define the JSON to JSON mapping with a Liquid template and store that map in your integration account. This article shows you how to create and use this Liquid template or map.
27
18
28
19
## Prerequisites
29
20
30
-
* An Azure subscription. If you don't have a subscription, you can
31
-
[start with a free Azure account](https://azure.microsoft.com/free/).
32
-
Or, [sign up for a Pay-As-You-Go subscription](https://azure.microsoft.com/pricing/purchase-options/).
21
+
* An Azure subscription. If you don't have a subscription, [sign up for a free Azure account](https://azure.microsoft.com/free/).
33
22
34
23
* Basic knowledge about [how to create logic apps](../logic-apps/quickstart-create-first-logic-app-workflow.md)
35
24
@@ -39,10 +28,8 @@ Or, [sign up for a Pay-As-You-Go subscription](https://azure.microsoft.com/prici
39
28
40
29
## Create Liquid template or map for your integration account
41
30
42
-
1. For this example, create the sample Liquid template described
43
-
in this step. In your Liquid template, you can use
which use [DotLiquid](https://dotliquidmarkup.org/) and C# naming conventions.
31
+
1. For this example, create the sample Liquid template described in this step. In your Liquid template, you can use
32
+
[Liquid filters](https://shopify.github.io/liquid/basics/introduction/#filters), which use [DotLiquid](https://dotliquidmarkup.org/) and C# naming conventions.
46
33
47
34
> [!NOTE]
48
35
> Make sure the filter names use *sentence casing* in your template.
@@ -68,63 +55,64 @@ which use [DotLiquid](https://dotliquidmarkup.org/) and C# naming conventions.
68
55
}
69
56
```
70
57
71
-
2. Sign in to the [Azure portal](https://portal.azure.com).
72
-
On the main Azure menu, select **All resources**.
73
-
In the search box, find and select your integration account.
58
+
1. In the [Azure portal](https://portal.azure.com), from the Azure search box, enter `integration accounts`, and select **Integration accounts**.
4. Choose**Add** and provide these details for your map:
70
+
1. On the **Maps** pane, select**Add** and provide these details for your map:
82
71
83
72
| Property | Value | Description |
84
73
|----------|-------|-------------|
85
-
|**Name**| JsonToJsonTemplate | The name for your map, which is "JsonToJsonTemplate" in this example |
74
+
|**Name**|`JsonToJsonTemplate`| The name for your map, which is "JsonToJsonTemplate" in this example |
86
75
|**Map type**|**liquid**| The type for your map. For JSON to JSON transformation, you must select **liquid**. |
87
-
|**Map**|"SimpleJsonToJsonTemplate.liquid"| An existing Liquid template or map file to use for transformation, which is "SimpleJsonToJsonTemplate.liquid" in this example. To find this file, you can use the file picker. For map size limits, see [Limits and configuration](../logic-apps/logic-apps-limits-and-config.md#artifact-capacity-limits). |
76
+
|**Map**|`SimpleJsonToJsonTemplate.liquid`| An existing Liquid template or map file to use for transformation, which is "SimpleJsonToJsonTemplate.liquid" in this example. To find this file, you can use the file picker. For map size limits, see [Limits and configuration](../logic-apps/logic-apps-limits-and-config.md#artifact-capacity-limits). |
1. In the Logic App Designer, add the [Request trigger](../connectors/connectors-native-reqres.md#add-request) to your logic app.
100
86
101
-
3. Under the trigger, choose **New step**.
102
-
In the search box, enter "liquid" as your filter,
103
-
and select this action: **Transform JSON to JSON - Liquid**
87
+
1. Under the trigger, choose **New step**. In the search box, enter `liquid` as your filter, and select this action: **Transform JSON to JSON - Liquid**
104
88
105
89

106
90
107
-
4. Click inside the **Content** box so that the dynamic content list appears,
If the maps list is empty, most likely your logic app is not linked to your integration account.
118
-
To link your logic app to the integration account that has the Liquid template or map,
119
-
follow these steps:
96
+
To link your logic app to the integration account that has the Liquid template or map, follow these steps:
120
97
121
98
1. On your logic app menu, select **Workflow settings**.
122
99
123
-
2. From the **Select an Integration account** list,
124
-
select your integration account, and choose **Save**.
100
+
1. From the **Select an Integration account** list, select your integration account, and select **Save**.
125
101
126
102

127
103
104
+
1. Now add the **Content** property to this action. Open the **Add new parameter** list, and select **Content**.
105
+
106
+

107
+
108
+
1. To set the **Content** property value, click inside the **Content** box so that the dynamic content list appears. Select the **Body** token, which represents the body content output from the trigger.
109
+
110
+

111
+
112
+
When you're done, the action looks like this example:
113
+
114
+

115
+
128
116
## Test your logic app
129
117
130
118
Post JSON input to your logic app from [Postman](https://www.getpostman.com/postman) or a similar tool.
0 commit comments