Skip to content

Commit 504b40e

Browse files
Merge pull request #278871 from ecfan/scope
Update expression for getting Scope action result
2 parents a3c7993 + fa9bb0f commit 504b40e

17 files changed

+26
-35
lines changed

articles/logic-apps/logic-apps-control-flow-run-steps-group-scopes.md

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: Group and run actions by scope
3-
description: Create scoped actions that run based on group status in Azure Logic Apps.
3+
description: Group actions that run based on group status in Azure Logic Apps.
44
services: logic-apps
55
ms.suite: integration
66
ms.reviewer: estfan, azla
77
ms.topic: how-to
8-
ms.date: 01/04/2024
8+
ms.date: 06/21/2024
99
---
1010

1111
# Run actions based on group status by using scopes in Azure Logic Apps
@@ -114,7 +114,6 @@ so save your work often.
114114
| **Travel mode** | Driving | Enter the mode of travel for your route. This example uses this value "Driving" |
115115
| **Transit Date-Time** | None | Applies to transit mode only. |
116116
| **Transit Date-Type Type** | None | Applies to transit mode only. |
117-
||||
118117

119118
1. [Add a condition](../logic-apps/logic-apps-control-flow-conditional-statement.md)
120119
that checks whether the current travel time with traffic exceeds a specified time.
@@ -123,7 +122,7 @@ so save your work often.
123122
1. Rename the condition with this description:
124123
**If traffic time is more than specified time**
125124

126-
1. In the leftmost column, click inside the **Choose a value**
125+
1. In the leftmost column, select inside the **Choose a value**
127126
box so the dynamic content list appears. From that list,
128127
select the **Travel Duration Traffic** field, which is in seconds.
129128

@@ -138,10 +137,10 @@ so save your work often.
138137

139138
![Finished condition](./media/logic-apps-control-flow-run-steps-group-scopes/finished-condition.png)
140139

141-
1. In the **If true** branch, add a "send email" action for your email provider.
140+
1. In the **True** branch, add a "send email" action for your email provider.
142141
Set up this action by following the steps under this image:
143142

144-
![Add "Send an email" action to "If true" branch](./media/logic-apps-control-flow-run-steps-group-scopes/send-email.png)
143+
![Add "Send an email" action to "True" branch](./media/logic-apps-control-flow-run-steps-group-scopes/send-email.png)
145144

146145
1. In the **To** field, enter your email address for testing purposes.
147146

@@ -157,13 +156,13 @@ so save your work often.
157156
the dynamic content list stays open so that you can
158157
select any parameters that are available at this point.
159158

160-
1. In the dynamic content list, choose **Expression**.
159+
1. In the dynamic content list, select **Expression**.
161160

162161
1. Find and select the **div()** function.
163162
Put your cursor in inside the function's parentheses.
164163

165164
1. While your cursor is inside the function's parentheses,
166-
choose **Dynamic content** so that the dynamic content list appears.
165+
select **Dynamic content** so that the dynamic content list appears.
167166

168167
1. From the **Get route** section,
169168
select the **Traffic Duration Traffic** field.
@@ -183,11 +182,10 @@ so save your work often.
183182
184183
![Finish expression](./media/logic-apps-control-flow-run-steps-group-scopes/send-email-3.png)
185184
186-
1. When you're done, choose **OK**.
185+
1. When you're done, select **OK**.
187186
188187
<!-- markdownlint-disable MD038 -->
189-
1. After the expression resolves,
190-
add this text with a leading space: ``` minutes```
188+
1. After the expression resolves, add this text with a leading space: ` minutes`
191189
192190
Your **Body** field now looks like this example:
193191
@@ -201,14 +199,14 @@ specific actions and evaluate their status.
201199
202200
## Add a scope
203201
204-
1. If you haven't already, open your logic app in Logic App Designer.
202+
1. If you haven't already, open your logic app in the workflow designer.
205203
206204
1. Add a scope at the workflow location that you want. For example,
207205
to add a scope between existing steps in the logic app workflow,
208206
follow these steps:
209207
210208
1. Move your pointer over the arrow where you want to add the scope.
211-
Choose the **plus sign** (**+**) > **Add an action**.
209+
Select the **plus sign** (**+**) > **Add an action**.
212210
213211
![Add a scope](./media/logic-apps-control-flow-run-steps-group-scopes/add-scope.png)
214212
@@ -235,15 +233,15 @@ Rename the condition with this description: **If scope failed**
235233
![Add condition to check scope status](./media/logic-apps-control-flow-run-steps-group-scopes/add-condition-check-scope-status.png)
236234
237235
1. In the condition, add these expressions that check whether
238-
the scope's status is equal to "Failed" or "Aborted".
236+
the scope's status is equal to "Failed" or "Aborted".
239237
240-
1. To add another row, choose **Add**.
238+
1. To add another row, select **Add**.
241239
242-
1. In each row, click inside the left box so the dynamic content list appears.
243-
From the dynamic content list, choose **Expression**. In the edit box,
244-
enter this expression, and then choose **OK**:
240+
1. In each row, select inside the left box so the dynamic content list appears.
241+
From the dynamic content list, select **Expression**. In the edit box,
242+
enter this expression, and then select **OK**:
245243
246-
`result('Scope')[0]['status']`
244+
`action('Scope')`
247245
248246
![Screenshot that shows the "Expression" box with the result expression highlighted.](./media/logic-apps-control-flow-run-steps-group-scopes/check-scope-status.png)
249247
@@ -259,8 +257,8 @@ the scope's status is equal to "Failed" or "Aborted".
259257
Now, set the condition's `runAfter` property so the condition checks the
260258
scope status and runs the matching action that you define in later steps.
261259
262-
1. On the **If scope failed** condition, choose the **ellipsis** (...) button,
263-
and then choose **Configure run after**.
260+
1. On the **If scope failed** condition, select the **ellipsis** (...) button,
261+
and then select **Configure run after**.
264262
265263
![Configure `runAfter` property](./media/logic-apps-control-flow-run-steps-group-scopes/configure-run-after.png)
266264
@@ -269,10 +267,10 @@ the scope's status is equal to "Failed" or "Aborted".
269267
270268
![Select scope statuses](./media/logic-apps-control-flow-run-steps-group-scopes/select-run-after-statuses.png)
271269
272-
1. When you're finished, choose **Done**.
270+
1. When you're finished, select **Done**.
273271
The condition now shows an "information" icon.
274272
275-
1. In the **If true** and **If false** branches,
273+
1. In the **True** and **False** branches,
276274
add the actions that you want to perform based on
277275
each scope status, for example, send an email or message.
278276
@@ -286,7 +284,7 @@ Your finished logic app now looks like this example:
286284
287285
## Test your work
288286
289-
On the designer toolbar, choose **Run**. If all the scoped actions succeed,
287+
On the designer toolbar, select **Run** > **Run**. If all the scoped actions succeed,
290288
you get a "Scope succeeded" message. If any scoped actions don't succeed,
291289
you get a "Scope failed" message.
292290
@@ -319,7 +317,7 @@ here is the JSON definition for trigger and actions in the previous logic app:
319317
"type": "ApiConnection",
320318
"inputs": {
321319
"body": {
322-
"Body": "Scope failed. Scope status: @{result('Scope')[0]['status']}",
320+
"Body": "Scope failed. Scope status: @{action('Scope')}",
323321
"Subject": "Scope failed",
324322
325323
},
@@ -340,7 +338,7 @@ here is the JSON definition for trigger and actions in the previous logic app:
340338
"type": "ApiConnection",
341339
"inputs": {
342340
"body": {
343-
"Body": "Scope succeeded. Scope status: @{result('Scope')[0]['status']}",
341+
"Body": "Scope succeeded. Scope status: @{action('Scope')}",
344342
"Subject": "Scope succeeded",
345343
346344
},
@@ -360,13 +358,13 @@ here is the JSON definition for trigger and actions in the previous logic app:
360358
"or": [
361359
{
362360
"equals": [
363-
"@result('Scope')[0]['status']",
361+
"@action('Scope')",
364362
"Failed"
365363
]
366364
},
367365
{
368366
"equals": [
369-
"@result('Scope')[0]['status']",
367+
"@action('Scope')",
370368
"Aborted"
371369
]
372370
}
@@ -448,13 +446,6 @@ here is the JSON definition for trigger and actions in the previous logic app:
448446
},
449447
```
450448

451-
## Get support
452-
453-
* For questions, visit the
454-
[Microsoft Q&A question page for Azure Logic Apps](/answers/topics/azure-logic-apps.html).
455-
* To submit or vote on features and suggestions,
456-
visit the [Azure Logic Apps user feedback site](https://aka.ms/logicapps-wish).
457-
458449
## Next steps
459450

460451
* [Run steps based on a condition (condition action)](../logic-apps/logic-apps-control-flow-conditional-statement.md)
821 Bytes
Loading
617 Bytes
Loading
5.23 KB
Loading
289 Bytes
Loading
4.13 KB
Loading
1.89 KB
Loading
-260 Bytes
Loading
510 Bytes
Loading
-12.8 KB
Loading

0 commit comments

Comments
 (0)