Skip to content

Commit 6395ab5

Browse files
authored
Merge pull request #15699 from ecfan/art-fix
Fix art and steps
2 parents e5ec175 + b57f523 commit 6395ab5

File tree

8 files changed

+87
-50
lines changed

8 files changed

+87
-50
lines changed

articles/logic-apps/logic-apps-use-logic-app-features.md

Lines changed: 87 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Add conditional logic and start workflows - Azure Logic Apps | Microsoft Docs
2+
title: Add conditions and start workflows - Azure Logic Apps | Microsoft Docs
33
description: Control how workflows run in Azure Logic Apps by adding conditional logic, triggers, actions, and parameters.
44
author: stepsic-microsoft-com
55
manager: anneta
@@ -18,54 +18,86 @@ ms.author: LADocs; stepsic
1818

1919
---
2020
# Use Logic Apps features
21-
In the [previous topic](../logic-apps/logic-apps-create-a-logic-app.md),
22-
you created your first logic app.
23-
Now you'll build a fuller process with Azure Logic Apps.
24-
This topic introduces the following new Azure Logic Apps concepts:
2521

26-
* Conditional logic, which executes an action only when a certain condition is met.
27-
* Code view to edit an existing logic app.
28-
* Options for starting a workflow.
22+
In a [previous topic](../logic-apps/logic-apps-create-a-logic-app.md),
23+
you created your first logic app. To control your logic app's workflow,
24+
you can specify different paths for your logic app to run and how to
25+
process data in arrays, collections, and batches. You can include these
26+
elements in your logic app workflow:
2927

30-
Before you complete this topic, you should complete the steps in [Create a new logic app](../logic-apps/logic-apps-create-a-logic-app.md). In the [Azure portal], browse to your logic app and click **Triggers and Actions** in the summary to edit the logic app definition.
28+
* Conditions and [switch statements](../logic-apps/logic-apps-switch-case.md)
29+
let your logic app run different actions based on whether specific conditions are met.
3130

32-
## Reference material
33-
You may find the following documents useful:
31+
* [Loops](../logic-apps/logic-apps-loops-and-scopes.md) let your logic app run steps repeatedly.
32+
For example, you can repeat actions over an array when you use a **For_each** loop.
33+
Or you can repeat actions until a condition is met when you use an **Until** loop.
3434

35-
* [Management and runtime REST APIs](https://msdn.microsoft.com/library/azure/mt643787.aspx) - including how to invoke Logic apps directly
36-
* [Language reference](https://msdn.microsoft.com/library/azure/mt643789.aspx) - a comprehensive list of all supported functions/expressions
37-
* [Trigger and action types](https://msdn.microsoft.com/library/azure/mt643939.aspx) - the different types of actions and the inputs they take
38-
* [Overview of App Service](../app-service/app-service-value-prop-what-is.md) - description of what components to choose when to build a solution
35+
* [Scopes](../logic-apps/logic-apps-loops-and-scopes.md) let you group series
36+
of actions together, for example, to implement exception handling.
3937

40-
## Add conditional logic to your logic app
38+
* [Debatching](../logic-apps/logic-apps-loops-and-scopes.md) lets your logic app
39+
start separate workflows for items in an array when you use the **SplitOn** command.
4140

42-
Although your logic app's original flow works, we could improve some areas.
41+
This topic introduces other concepts for building your logic app:
4342

44-
### Conditional
43+
* Code view to edit an existing logic app
44+
* Options for starting a workflow
4545

46-
Your first logic app might result in you getting too many emails.
47-
The following steps add conditional logic so that you receive email
48-
only when the tweet comes from someone with a specific number of followers.
46+
## Conditions: Run steps only after meeting a condition
4947

50-
0. In the Logic App Designer, choose **New Step** (+) > **Add an action**.
51-
0. Find and add the **Get User** action for Twitter.
52-
0. To get the information about the Twitter user,
53-
find and add the **Tweeted by** field from the trigger.
48+
To have your logic app run steps only when data meets specific criteria,
49+
you can add a condition that compares data in the workflow against specific fields or values.
5450

55-
![Get user](media/logic-apps-use-logic-app-features/getuser.png)
51+
For example, suppose you have a logic app that sends you too many emails
52+
for posts on a website's RSS feed. You can add a condition so that your
53+
logic app sends email only when the new post belongs to a specific category.
5654

57-
0. Choose **New Step** (+) > **Add a condition**.
58-
0. To filter on the number of followers that users have,
59-
under **Object name**, choose **Add dynamic content**.
60-
0. In the search box, find and add the **Followers count** field.
61-
0. Under **Relationship**, select **is greater than**.
62-
0. In the **Value** box, enter the number of followers you want users to have.
55+
1. In the [Azure portal](https://portal.azure.com),
56+
find and open your logic app in Logic App Designer.
6357

64-
![Conditional](media/logic-apps-use-logic-app-features/conditional.png)
58+
2. Add a condition to the workflow location that you want.
6559

66-
0. Finally, drag the **Send email** box into the **If Yes** box.
60+
To add the condition between existing steps in the logic app workflow,
61+
move the pointer over the arrow where you want to add the condition.
62+
Choose the **plus sign** (**+**), then choose **Add a condition**. For example:
6763

68-
Now you get emails only when the follower count meets your condition.
64+
![Add condition to logic app](./media/logic-apps-use-logic-app-features/add-condition.png)
65+
66+
> [!NOTE]
67+
> If you want to add a condition at the end of your current workflow,
68+
> go to the bottom of your logic app, and choose **+ New step**.
69+
70+
3. Now define the condition. Specify the source field that you want to evaluate,
71+
the operation to perform, and the target value or field.
72+
To add existing fields to your condition, choose from the **Add dynamic content list**.
73+
74+
For example:
75+
76+
![Edit condition in basic mode](./media/logic-apps-use-logic-app-features/edit-condition-basic-mode.png)
77+
78+
Here's the complete condition:
79+
80+
![Complete condition](./media/logic-apps-use-logic-app-features/edit-condition-basic-mode-2.png)
81+
82+
> [!TIP]
83+
> To define the condition in code, choose **Edit in advanced mode**.
84+
> For example:
85+
>
86+
> ![Edit condition in code](./media/logic-apps-use-logic-app-features/edit-condition-advanced-mode.png)
87+
88+
4. Under **IF YES** and **IF NO**, add the steps to perform based
89+
on whether the condition is met.
90+
91+
For example:
92+
93+
![Condition with YES and NO paths](./media/logic-apps-use-logic-app-features/condition-yes-no-path.png)
94+
95+
> [!TIP]
96+
> You can drag existing actions into the **IF YES** and **IF NO** paths.
97+
98+
5. When you're done, save your logic app.
99+
100+
Now you get emails only when the posts meet your condition.
69101

70102
## Repeat actions over a list with forEach
71103

@@ -94,7 +126,7 @@ you can directly edit the code that defines a logic app.
94126

95127
2. To save your edits, choose **Save**.
96128

97-
### Parameters
129+
## Parameters
98130

99131
Some Logic Apps capabilities are available only in code view,
100132
for example, parameters. Parameters make it easy to reuse
@@ -103,35 +135,34 @@ an email address that you want use in several actions,
103135
you should define that email address as a parameter.
104136

105137
Parameters are good for pulling out values that you are likely to change a lot.
106-
They are especially useful when you need to override parameters in different environments.
107-
To learn how to override parameters based on environment,
108-
see the [REST API documentation](https://docs.microsoft.com/rest/api/logic).
138+
They are especially useful when you need to override parameters in different environments. To learn how to override parameters based on environment,
139+
see [Author logic app definitions](../logic-apps/logic-apps-author-definitions.md) and [REST API documentation](https://docs.microsoft.com/rest/api/logic).
109140

110141
This example shows how to update your existing logic app
111142
so that you can use parameters for the query term.
112143

113144
1. In code view, find the `parameters : {}` object,
114-
and add a topic object:
145+
and add a `currentFeedUrl` object:
115146

116-
"topic" : {
147+
"currentFeedUrl" : {
117148
"type" : "string",
118-
"defaultValue" : "MicrosoftAzure"
149+
"defaultValue" : "http://rss.cnn.com/rss/cnn_topstories.rss"
119150
}
120151

121-
2. Go to the `twitterconnector` action, find the query value,
122-
and replace that value with `#@{parameters('topic')}`.
152+
2. Go to the `When_a_feed-item_is_published` action,
153+
find the `queries` section, and replace the query value with
154+
: `"feedUrl": "#@{parameters('currentFeedUrl')}"`
123155

124156
To join two or more strings, you can also use the `concat` function.
125-
For example, `@concat('#',parameters('topic'))` works the same as the above.
157+
For example, `"@concat('#',parameters('currentFeedUrl'))"`
158+
works the same as the above.
126159

127160
3. When you're done, choose **Save**.
128161

129-
Now every hour, you get new tweets
130-
that have more than five retweets
131-
delivered to a folder called **tweets** in your Dropbox.
162+
Now you can change the website's RSS feed by
163+
passing a different URL through the `currentFeedURL` object.
132164

133-
To learn more about Logic App definitions, see
134-
[author Logic App definitions](../logic-apps/logic-apps-author-definitions.md).
165+
Learn more about [how to author logic app definitions](../logic-apps/logic-apps-author-definitions.md).
135166

136167
## Start logic app workflows
137168

@@ -157,3 +188,9 @@ See [Start workflows by calling logic app endpoints as triggers](../logic-apps/l
157188

158189
<!-- Shared links -->
159190
[Azure portal]: https://portal.azure.com
191+
192+
## Next steps
193+
194+
* [Switch statements](../logic-apps/logic-apps-switch-case.md)
195+
* [Loops, scopes, and debatching](../logic-apps/logic-apps-loops-and-scopes.md)
196+
* [Author logic app definitions](../logic-apps/logic-apps-author-definitions.md)
13.5 KB
Loading
19.6 KB
Loading
Binary file not shown.
5.1 KB
Loading
16.6 KB
Loading
30.9 KB
Loading
Binary file not shown.

0 commit comments

Comments
 (0)