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/add-run-javascript.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Add and run JavaScript code snippets in workflows
2
+
title: Add and run JavaScript in workflows
3
3
description: Write and run JavaScript code snippets in workflows to perform custom integration tasks using Inline Code operations in Azure Logic Apps.
4
4
services: logic-apps
5
5
ms.suite: integration
@@ -10,7 +10,7 @@ ms.custom: devx-track-js
10
10
# Customer intent: As a logic app workflow developer, I want to write and run my own JavaScript code snippets so that I can perform custom integration tasks in Standard workflows for Azure Logic Apps.
11
11
---
12
12
13
-
# Add and run JavaScript code snippets inline with workflows for Azure Logic Apps
13
+
# Add and run JavaScript code inline with workflows for Azure Logic Apps
@@ -28,11 +28,11 @@ The following diagram shows the highlights from example workflow:
28
28
29
29
### [Consumption](#tab/consumption)
30
30
31
-
:::image type="content" source="media/logic-apps-add-run-inline-code/inline-code-overview-consumption.png" alt-text="Screenshot shows example Consumption workflow with the Execute JavaScript Code action." lightbox="media/logic-apps-add-run-inline-code/inline-code-overview-consumption.png":::
31
+
:::image type="content" source="media/add-run-javascript/inline-code-overview-consumption.png" alt-text="Screenshot shows example Consumption workflow with the Execute JavaScript Code action." lightbox="media/add-run-javascript/inline-code-overview-consumption.png":::
32
32
33
33
### [Standard](#tab/standard)
34
34
35
-
:::image type="content" source="media/logic-apps-add-run-inline-code/inline-code-overview-standard.png" alt-text="Screenshot shows example Standard workflow with the Execute JavaScript Code action." lightbox="media/logic-apps-add-run-inline-code/inline-code-overview-standard.png":::
35
+
:::image type="content" source="media/add-run-javascript/inline-code-overview-standard.png" alt-text="Screenshot shows example Standard workflow with the Execute JavaScript Code action." lightbox="media/add-run-javascript/inline-code-overview-standard.png":::
36
36
37
37
---
38
38
@@ -87,7 +87,7 @@ The following diagram shows the highlights from example workflow:
87
87
88
88
This example adds the action under the Office 365 Outlook trigger. By default, the action contains some sample code, including a `return` statement.
89
89
90
-

90
+

91
91
92
92
1. In the **Code** box, delete the sample code, and enter your code. Write the code that you'd put inside a method, but without the method signature.
93
93
@@ -98,15 +98,15 @@ The following diagram shows the highlights from example workflow:
98
98
99
99
If you start typing a recognized keyword, the autocomplete list appears so that you can select from available keywords, for example:
100
100
101
-

101
+

102
102
103
103
The following example code snippet first creates a variable named **myResult** that stores a *regular expression*, which specifies a pattern to match in input text. The code then creates a variable named **email** that stores the email message's body content from the trigger outputs.
104
104
105
-

105
+

106
106
107
107
1. With your cursor still in the **Code** box, from the open dynamic content list, find the **When a new email arrives** section, and select the **Body** property, which references the email message's body.
108
108
109
-

109
+

110
110
111
111
The dynamic content list shows the outputs from the trigger and any preceding actions when those outputs match the input format for the edit box that's currently in focus. This list makes these outputs easier to use and reference from your workflow. For this example, the list shows the outputs from the Outlook trigger, including the email message's **Body** property.
112
112
@@ -130,13 +130,13 @@ The following diagram shows the highlights from example workflow:
130
130
131
131
1. To differentiate the email message's **Body** property that you selected from the trigger's `body` property, rename the second `body` property to `Body` instead. Add the closing semicolon (**;**) at the end to finish the code statement.
132
132
133
-

133
+

134
134
135
135
The **Execute JavaScript Code** action doesn't syntactically require a `return` statement. However, by including the `return` statement, you can more easily reference the action results later in your workflow by using the **Result** token in later actions.
136
136
137
137
In this example, the code snippet returns the result by calling the `match()` function, which finds any matches in the email message body to the specified regular expression. The **Create HTML table** action then uses the **Result** token to reference the results from the **Execute JavaScript Code** action and creates a single result.
138
138
139
-

139
+

140
140
141
141
1. When you're done, save your workflow.
142
142
@@ -150,19 +150,19 @@ The following diagram shows the highlights from example workflow:
150
150
151
151
If you start typing a recognized keyword, the autocomplete list appears so that you can select from available keywords, for example:
152
152
153
-

153
+

154
154
155
155
The following example code snippet first creates a variable named **myResult** that stores a *regular expression*, which specifies a pattern to match in input text. The code then creates a variable named **email** that stores the email message's body content from the trigger outputs.
156
156
157
-

157
+

158
158
159
159
1. With your cursor still in the **Code** box, follow these steps:
160
160
161
161
1. In the **Code** box's lower right corner, select **Dynamic content** to open the dynamic content list.
162
162
163
163
1. From the opened list, find the **When a new email arrives** section, and select the **Body** token, which references the email's message body.
164
164
165
-

165
+

166
166
167
167
The dynamic content list shows the outputs from the trigger and any preceding actions where those outputs match the input format for the edit box that's currently in focus. This list makes these outputs easier to use and reference from your workflow. For this example, the list shows the outputs from the Outlook trigger, including the email message's **Body** property.
168
168
@@ -175,28 +175,28 @@ The following diagram shows the highlights from example workflow:
> Also, in the **Execute JavaScript Code** action, you have to add the **Actions** parameter
184
184
> and then add these action names to that parameter. For more information, see
185
185
> [Add dependencies as parameters to an Execute JavaScript Code action](#add-parameters) later in this article.
186
186
187
187
1. To differentiate the email message's **Body** property that you selected from the trigger's `body` property, rename the second `body` property to `Body` instead. Add the closing semicolon (**;**) at the end to finish the code statement.
188
188
189
-

189
+

190
190
191
191
The **Execute JavaScript Code** doesn't syntactically require a `return` statement. However, by including the `return` statement, you can reference the action results later in your workflow by using the **Outputs** token in later actions.
192
192
193
193
In this example, the code snippet returns the result by calling the `match()` function, which finds any matches in the email message body to the specified regular expression.
194
194
195
-

195
+

196
196
197
197
The **Create HTML table** action then uses the **Outputs** token to reference the results from the **Execute JavaScript Code** action and creates a single result.
198
198
199
-

199
+

200
200
201
201
1. When you're done, save your workflow.
202
202
@@ -322,11 +322,11 @@ For example, suppose the Office 365 Outlook connector's **Send approval email**
322
322
323
323
### [Consumption](#tab/consumption)
324
324
325
-

325
+

326
326
327
327
### [Standard](#tab/standard)
328
328
329
-

329
+

330
330
331
331
---
332
332
@@ -348,7 +348,7 @@ Before you start, you need the JSON name for the trigger or action in the underl
348
348
349
349
For example, `Send_approval_email` is the JSON name for the **Send approval email** action.
350
350
351
-

351
+

352
352
353
353
1. To return to designer view, on the code view toolbar, select **Designer**.
354
354
@@ -360,7 +360,7 @@ Before you start, you need the JSON name for the trigger or action in the underl
360
360
361
361
For example, `Send_approval_email` is the JSON name for the **Send approval email** action.
362
362
363
-

363
+

364
364
365
365
1. To return to designer view, on the workflow menu, select **Designer**.
366
366
@@ -382,11 +382,11 @@ Before you start, you need the JSON name for the trigger or action in the underl
382
382
383
383
1. For this example, select the **Actions** parameter.
384
384
385
-

385
+

386
386
387
387
1. In the **Actions Item - 1** box, enter the action's JSON name.
388
388
389
-

389
+

390
390
391
391
1. To add another action name, select **Add new item**.
0 commit comments