Skip to content

Commit 81b7da7

Browse files
author
ecfan
committed
Updates and file renames
1 parent e771b97 commit 81b7da7

23 files changed

+536
-41
lines changed

articles/logic-apps/.openpublishing.redirection.logic-apps.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"redirections": [
3+
{
4+
"source_path_from_root": "/articles/logic-apps/logic-apps-add-run-inline-code.md",
5+
"redirect_url": "/azure/logic-apps/add-run-javascript",
6+
"redirect_document_id": true
7+
},
38
{
49
"source_path_from_root": "/articles/logic-apps/logic-apps-azure-functions.md",
510
"redirect_url": "/azure/logic-apps/call-azure-functions-from-workflows",

articles/logic-apps/add-run-csharp-scripts.md

Lines changed: 507 additions & 17 deletions
Large diffs are not rendered by default.

articles/logic-apps/logic-apps-add-run-inline-code.md renamed to articles/logic-apps/add-run-javascript.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Add and run JavaScript code snippets in workflows
2+
title: Add and run JavaScript in workflows
33
description: Write and run JavaScript code snippets in workflows to perform custom integration tasks using Inline Code operations in Azure Logic Apps.
44
services: logic-apps
55
ms.suite: integration
@@ -10,7 +10,7 @@ ms.custom: devx-track-js
1010
# 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.
1111
---
1212

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
1414

1515
[!INCLUDE [logic-apps-sku-consumption-standard](~/reusable-content/ce-skilling/azure/includes/logic-apps-sku-consumption-standard.md)]
1616

@@ -28,11 +28,11 @@ The following diagram shows the highlights from example workflow:
2828

2929
### [Consumption](#tab/consumption)
3030

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":::
3232

3333
### [Standard](#tab/standard)
3434

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":::
3636

3737
---
3838

@@ -87,7 +87,7 @@ The following diagram shows the highlights from example workflow:
8787

8888
This example adds the action under the Office 365 Outlook trigger. By default, the action contains some sample code, including a `return` statement.
8989

90-
![Screenshot showing the Execute JavaScript Code action with default sample code.](./media/logic-apps-add-run-inline-code/inline-code-action-default-consumption.png)
90+
![Screenshot showing the Execute JavaScript Code action with default sample code.](./media/add-run-javascript/inline-code-action-default-consumption.png)
9191

9292
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.
9393

@@ -98,15 +98,15 @@ The following diagram shows the highlights from example workflow:
9898
9999
If you start typing a recognized keyword, the autocomplete list appears so that you can select from available keywords, for example:
100100

101-
![Screenshot showing the Consumption workflow, Execute JavaScript Code action, and keyword autocomplete list.](./media/logic-apps-add-run-inline-code/auto-complete-consumption.png)
101+
![Screenshot showing the Consumption workflow, Execute JavaScript Code action, and keyword autocomplete list.](./media/add-run-javascript/auto-complete-consumption.png)
102102

103103
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.
104104

105-
![Screenshot showing the Consumption workflow, Execute JavaScript Code action, and example code that creates variables.](./media/logic-apps-add-run-inline-code/save-email-body-variable-consumption.png)
105+
![Screenshot showing the Consumption workflow, Execute JavaScript Code action, and example code that creates variables.](./media/add-run-javascript/save-email-body-variable-consumption.png)
106106

107107
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.
108108

109-
![Screenshot showing the Consumption workflow, Execute JavaScript Code action, dynamic content list, and email message's "Body" property selected.](./media/logic-apps-add-run-inline-code/select-output-consumption.png)
109+
![Screenshot showing the Consumption workflow, Execute JavaScript Code action, dynamic content list, and email message's "Body" property selected.](./media/add-run-javascript/select-output-consumption.png)
110110

111111
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.
112112

@@ -130,13 +130,13 @@ The following diagram shows the highlights from example workflow:
130130
131131
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.
132132

133-
![Screenshot showing the Consumption logic app workflow, Execute JavaScript Code action, and renamed "Body" property with closing semicolon.](./media/logic-apps-add-run-inline-code/rename-body-property-consumption.png)
133+
![Screenshot showing the Consumption logic app workflow, Execute JavaScript Code action, and renamed "Body" property with closing semicolon.](./media/add-run-javascript/rename-body-property-consumption.png)
134134

135135
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.
136136

137137
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.
138138

139-
![Screenshot showing the finished Consumption logic app workflow.](./media/logic-apps-add-run-inline-code/inline-code-complete-example-consumption.png)
139+
![Screenshot showing the finished Consumption logic app workflow.](./media/add-run-javascript/inline-code-complete-example-consumption.png)
140140

141141
1. When you're done, save your workflow.
142142

@@ -150,19 +150,19 @@ The following diagram shows the highlights from example workflow:
150150

151151
If you start typing a recognized keyword, the autocomplete list appears so that you can select from available keywords, for example:
152152

153-
![Screenshot showing the Standard workflow, Execute JavaScript Code action, and keyword autocomplete list.](./media/logic-apps-add-run-inline-code/auto-complete-standard.png)
153+
![Screenshot showing the Standard workflow, Execute JavaScript Code action, and keyword autocomplete list.](./media/add-run-javascript/auto-complete-standard.png)
154154

155155
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.
156156

157-
![Screenshot showing the Standard workflow, Execute JavaScript Code action, and example code that creates variables.](./media/logic-apps-add-run-inline-code/save-email-body-variable-standard.png)
157+
![Screenshot showing the Standard workflow, Execute JavaScript Code action, and example code that creates variables.](./media/add-run-javascript/save-email-body-variable-standard.png)
158158

159159
1. With your cursor still in the **Code** box, follow these steps:
160160

161161
1. In the **Code** box's lower right corner, select **Dynamic content** to open the dynamic content list.
162162

163163
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.
164164

165-
![Screenshot showing the Standard workflow, Execute JavaScript Code action, dynamic content list, and email message's "Body" property selected.](./media/logic-apps-add-run-inline-code/select-output-standard.png)
165+
![Screenshot showing the Standard workflow, Execute JavaScript Code action, dynamic content list, and email message's "Body" property selected.](./media/add-run-javascript/select-output-standard.png)
166166

167167
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.
168168

@@ -175,28 +175,28 @@ The following diagram shows the highlights from example workflow:
175175
> and quotation marks (**""**), for example:
176176
>
177177
> `// Correct`</br>
178-
> `workflowContext.actions["my.action.name"].body`
178+
> `workflowContext.actions["myAction.name"].body`
179179
>
180180
> `// Incorrect`</br>
181-
> `workflowContext.actions.my.action.name.body`
181+
> `workflowContext.actions.myAction.name.body`
182182
>
183183
> Also, in the **Execute JavaScript Code** action, you have to add the **Actions** parameter
184184
> and then add these action names to that parameter. For more information, see
185185
> [Add dependencies as parameters to an Execute JavaScript Code action](#add-parameters) later in this article.
186186
187187
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.
188188

189-
![Screenshot showing the Standard logic app workflow, Execute JavaScript Code action, and renamed Body property with closing semicolon.](./media/logic-apps-add-run-inline-code/rename-body-property-standard.png)
189+
![Screenshot showing the Standard logic app workflow, Execute JavaScript Code action, and renamed Body property with closing semicolon.](./media/add-run-javascript/rename-body-property-standard.png)
190190

191191
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.
192192

193193
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.
194194

195-
![Screenshot showing the Standard logic app workflow and Execute JavaScript Code action with a return statement.](./media/logic-apps-add-run-inline-code/return-statement-standard.png)
195+
![Screenshot showing the Standard logic app workflow and Execute JavaScript Code action with a return statement.](./media/add-run-javascript/return-statement-standard.png)
196196

197197
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.
198198

199-
![Screenshot showing the finished Standard logic app workflow.](./media/logic-apps-add-run-inline-code/inline-code-complete-example-standard.png)
199+
![Screenshot showing the finished Standard logic app workflow.](./media/add-run-javascript/inline-code-complete-example-standard.png)
200200

201201
1. When you're done, save your workflow.
202202

@@ -322,11 +322,11 @@ For example, suppose the Office 365 Outlook connector's **Send approval email**
322322

323323
### [Consumption](#tab/consumption)
324324

325-
![Screenshot that shows the Consumption workflow and Execute JavaScript Code action with updated example code snippet.](./media/logic-apps-add-run-inline-code/add-actions-parameter-code-snippet-consumption.png)
325+
![Screenshot that shows the Consumption workflow and Execute JavaScript Code action with updated example code snippet.](./media/add-run-javascript/add-actions-parameter-code-snippet-consumption.png)
326326

327327
### [Standard](#tab/standard)
328328

329-
![Screenshot that shows the Standard workflow and Execute JavaScript Code action with updated example code snippet.](./media/logic-apps-add-run-inline-code/add-actions-parameter-code-snippet-standard.png)
329+
![Screenshot that shows the Standard workflow and Execute JavaScript Code action with updated example code snippet.](./media/add-run-javascript/add-actions-parameter-code-snippet-standard.png)
330330

331331
---
332332

@@ -348,7 +348,7 @@ Before you start, you need the JSON name for the trigger or action in the underl
348348

349349
For example, `Send_approval_email` is the JSON name for the **Send approval email** action.
350350

351-
![Screenshot showing the action name in JSON.](./media/logic-apps-add-run-inline-code/find-action-name-json.png)
351+
![Screenshot showing the action name in JSON.](./media/add-run-javascript/find-action-name-json.png)
352352

353353
1. To return to designer view, on the code view toolbar, select **Designer**.
354354

@@ -360,7 +360,7 @@ Before you start, you need the JSON name for the trigger or action in the underl
360360

361361
For example, `Send_approval_email` is the JSON name for the **Send approval email** action.
362362

363-
![Screenshot showing the action name in JSON.](./media/logic-apps-add-run-inline-code/find-action-name-json.png)
363+
![Screenshot showing the action name in JSON.](./media/add-run-javascript/find-action-name-json.png)
364364

365365
1. To return to designer view, on the workflow menu, select **Designer**.
366366

@@ -382,11 +382,11 @@ Before you start, you need the JSON name for the trigger or action in the underl
382382

383383
1. For this example, select the **Actions** parameter.
384384

385-
![Screenshot showing the Execute JavaScript Code action with the Actions parameter selected.](./media/logic-apps-add-run-inline-code/add-actions-parameter.png)
385+
![Screenshot showing the Execute JavaScript Code action with the Actions parameter selected.](./media/add-run-javascript/add-actions-parameter.png)
386386

387387
1. In the **Actions Item - 1** box, enter the action's JSON name.
388388

389-
![Screenshot showing the Actions Item -1 box and the action's JSON name.](./media/logic-apps-add-run-inline-code/add-action-json-name.png)
389+
![Screenshot showing the Actions Item -1 box and the action's JSON name.](./media/add-run-javascript/add-action-json-name.png)
390390

391391
1. To add another action name, select **Add new item**.
392392

22.2 KB
Loading

0 commit comments

Comments
 (0)