Skip to content

Commit fa4ebea

Browse files
authored
Merge pull request #86449 from ecfan/result-function
Add entry for result function
2 parents 06ee831 + ca4c2b2 commit fa4ebea

File tree

2 files changed

+347
-51
lines changed

2 files changed

+347
-51
lines changed

articles/logic-apps/logic-apps-exception-handling.md

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
---
2-
# required metadata
3-
title: Error and exception handling - Azure Logic Apps | Microsoft Docs
2+
title: Error and exception handling - Azure Logic Apps
43
description: Learn about patterns for error and exception handling in Azure Logic Apps
54
services: logic-apps
65
ms.service: logic-apps
6+
ms.suite: integration
77
author: dereklee
88
ms.author: deli
9-
manager: jeconnoc
9+
ms.reviewer: klam, estfan, LADocs
1010
ms.date: 01/31/2018
1111
ms.topic: article
12-
13-
# optional metadata
14-
ms.reviewer: klam, LADocs
15-
ms.suite: integration
1612
---
1713

1814
# Handle errors and exceptions in Azure Logic Apps
@@ -272,29 +268,17 @@ you can create a single action to catch failures.
272268

273269
For limits on scopes, see [Limits and config](../logic-apps/logic-apps-limits-and-config.md).
274270

271+
<a name="get-results-from-failures"></a>
272+
275273
### Get context and results for failures
276274

277-
Although catching failures from a scope is useful,
278-
you might also want context to help you understand
279-
exactly which actions failed plus any errors or status codes that were returned.
280-
The `@result()` expression provides context about the result of all actions in a scope.
281-
282-
The `@result()` expression accepts a single parameter (the scope's name)
283-
and returns an array of all the action results from within that scope.
284-
These action objects include the same attributes as the **\@actions()** object,
285-
such as the action's start time, end time, status, inputs, correlation IDs, and outputs.
286-
To send context for any actions that failed within a scope,
287-
you can easily pair an **\@result()** function with a **runAfter** property.
288-
289-
To run an action for each action in a scope that has a **Failed** result,
290-
and to filter the array of results down to the failed actions,
291-
you can pair **\@result()** with a **[Filter Array](../connectors/connectors-native-query.md)** action
292-
and a [**For each**](../logic-apps/logic-apps-control-flow-loops.md) loop.
293-
You can take the filtered result array and perform an action for each failure using the **For each** loop.
294-
295-
Here's an example, followed by a detailed explanation,
296-
that sends an HTTP POST request with the response body
297-
for any actions that failed within the scope "My_Scope":
275+
Although catching failures from a scope is useful, you might also want context to help you understand exactly which actions failed plus any errors or status codes that were returned.
276+
277+
The [`result()`](../logic-apps/workflow-definition-language-functions-reference.md#result) function provides context about the results from all the actions in a scope. The `result()` function accepts a single parameter, which is the scope's name, and returns an array that contains all the action results from within that scope. These action objects include the same attributes as the `@actions()` object, such as the action's start time, end time, status, inputs, correlation IDs, and outputs. To send context for any actions that failed within a scope, you can easily pair a `@result()` expression with the `runAfter` property.
278+
279+
To run an action for each action in a scope that has a **Failed** result, and to filter the array of results down to the failed actions, you can pair a `@result()` expression with a [**Filter Array**](../connectors/connectors-native-query.md) action and a [**For each**](../logic-apps/logic-apps-control-flow-loops.md) loop. You can take the filtered result array and perform an action for each failure using the **For each** loop.
280+
281+
Here's an example, followed by a detailed explanation, that sends an HTTP POST request with the response body for any actions that failed within the scope "My_Scope":
298282

299283
```json
300284
"Filter_array": {

0 commit comments

Comments
 (0)