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
This guide shows how to add a condition to your workflow and use the result to help your workflow choose between two action paths.
27
27
28
28
## Prerequisites
29
29
30
30
* An Azure account and subscription. If you don't have a subscription, [sign up for a free Azure account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
31
31
32
-
* Basic knowledge about [logic app workflows](logic-apps-overview.md)
32
+
* Basic knowledge about [logic app workflows](logic-apps-overview.md).
33
33
34
34
* To follow the example in this how-to guide, create either an [example Consumption logic app workflow](quickstart-create-example-consumption-workflow.md) or an [example Standard logic app workflow](create-single-tenant-workflows-azure-portal.md) and use either an Outlook.com account or a Microsoft work or school account.
35
35
36
36
## Add a condition
37
37
38
38
### [Consumption](#tab/consumption)
39
39
40
-
1. In the [Azure portal](https://portal.azure.com), open your logic app workflow in the designer.
40
+
1. In the [Azure portal](https://portal.azure.com), open your Consumption logic app resource.
41
41
42
-
1.[Follow these general steps to add the **Condition** action to your workflow](create-workflow-with-trigger-or-action.md?tabs=consumption#add-action).
42
+
1. On the sidebar menu, under **Development Tools**, select the designer to open the blank workflow.
43
+
44
+
This example uses the **RSS** trigger named **When a feed item is published** to start the workflow. However, you can use any trigger that you want in your own scenarios.
45
+
46
+
1. Add the trigger that you want by following the [general steps to add a trigger](add-trigger-action-workflow.md?tabs=consumption#add-trigger).
47
+
48
+
1. Add the **Condition** action to your workflow by following the [general steps to add an action](add-trigger-action-workflow.md?tabs=consumption#add-action).
43
49
44
50
1. In the **Condition** action, follow these steps to build your condition:
45
51
46
52
1. In the left-side box named **Choose a value**, enter the first value or field that you want to compare.
47
53
48
-
When you select inside the **Choose a value** box, the dynamic content list opens automatically. From this list, you can select outputs from previous steps in your workflow.
54
+
After you select inside the **Choose a value** box, the options to open the dynamic content list (lightning icon) or expression editor (formula icon) appear.
55
+
56
+
:::image type="content" source="media/logic-apps-control-flow-conditional-statement/open-dynamic-content-consumption.png" alt-text="Screenshot shows Azure portal, Consumption workflow designer, RSS trigger, and Condition action with information pane open, and dynamic content button selected.":::
57
+
58
+
1. Select the lightning icon to open the dynamic content list.
49
59
50
-
This example selects the RSS trigger output named **Feed summary**.
60
+
From this list, you can select outputs from previous steps in your workflow. This example selects the **RSS** trigger output named **Feed summary**. If you don't see this option, you might need to select **See more**.
51
61
52
-

62
+
:::image type="content" source="media/logic-apps-control-flow-conditional-statement/edit-condition-consumption.png" alt-text="Screenshot shows Azure portal, Consumption workflow designer, RSS trigger, and Condition action with criteria construction.":::
53
63
54
-
1.Open the middle list, select the operation to perform.
64
+
1.From the middle box, select the operation to perform.
55
65
56
66
This example selects **contains**.
57
67
58
68
1. In the right-side box named **Choose a value**, enter the value or field that you want to compare with the first.
59
69
60
70
This example specifies the following string: **Microsoft**
61
71
62
-
The complete condition now looks like the following example:
72
+
The following example shows the complete condition:
63
73
64
-

74
+
:::image type="content" source="media/logic-apps-control-flow-conditional-statement/complete-condition-consumption.png" alt-text="Screenshot shows the Consumption workflow and the complete condition criteria.":::
65
75
66
-
- To add another row to your condition, from the **Add** menu, select **Add row**.
76
+
- To add another row to your condition, from the **New item** menu, select **Add row**.
67
77
68
-
- To add a group with subconditions, from the **Add** menu, select **Add group**.
78
+
- To add a group with subconditions, from the **New item** menu, select **Add group**.
69
79
70
80
- To group existing rows, select the checkboxes for those rows, select the ellipses (...) button for any row, and then select **Make group**.
71
81
72
82
1. In the **True** and **False** action paths, add the actions that you want to run, based on whether the condition is true or false respectively, for example:
73
83
74
-

84
+
:::image type="content" source="media/logic-apps-control-flow-conditional-statement/condition-true-false-path-consumption.png" alt-text="Screenshot shows the Consumption workflow and the condition with true and false paths.":::
75
85
76
86
> [!TIP]
77
87
>
@@ -81,27 +91,31 @@ This guide shows how to add a condition to your workflow and use the result to h
81
91
82
92
### [Standard](#tab/standard)
83
93
84
-
1. In the [Azure portal](https://portal.azure.com), open your logic app workflow in the designer.
94
+
1. In the [Azure portal](https://portal.azure.com), open your Standard logic app resource.
85
95
86
-
1.[Follow these general steps to add the **Condition** action to your workflow](create-workflow-with-trigger-or-action.md?tabs=standard#add-action).
96
+
1.On the resource sidebar menu, under **Workflows**, select **Workflows**, and then select your blank workflow.
87
97
88
-
1. On the designer, select the **Condition** action to open the information pane. Follow these steps to build your condition:
98
+
1. On the workflow sidebar menu, under **Tools**, select the designer to open the workflow.
99
+
100
+
1. Add the trigger named **When a feed item is published** to your workflow by following the [general steps to add a trigger](add-trigger-action-workflow.md?tabs=standard#add-trigger).
101
+
102
+
1. Add the **Condition** action to your workflow by following the [general steps to add an action](add-trigger-action-workflow.md?tabs=standard#add-action).
103
+
104
+
1. In the **Condition** action, follow these steps to build your condition:
89
105
90
106
1. In the left-side box named **Choose a value**, enter the first value or field that you want to compare.
91
107
92
108
After you select inside the **Choose a value** box, the options to open the dynamic content list (lightning icon) or expression editor (formula icon) appear.
93
109
94
-
1. Select the lightning icon to open the dynamic content list.
95
-
96
-
From this list, you can select outputs from previous steps in your workflow.
110
+
:::image type="content" source="media/logic-apps-control-flow-conditional-statement/open-dynamic-content-standard.png" alt-text="Screenshot shows Azure portal, Standard workflow designer, RSS trigger, and Condition action with information pane open, and dynamic content button selected.":::
97
111
98
-

112
+
1. Select the lightning icon to open the dynamic content list.
99
113
100
-
This example selects the RSS trigger output named **Feed summary**.
114
+
From this list, you can select outputs from previous steps in your workflow. This example selects the RSS trigger output named **Feed summary**.
101
115
102
-

116
+
:::image type="content" source="media/logic-apps-control-flow-conditional-statement/edit-condition-standard.png" alt-text="Screenshot shows Azure portal, Standard workflow designer, RSS trigger, and Condition action with criteria construction.":::
103
117
104
-
1. From the middle list, select the operation to perform.
118
+
1. From the middle box, select the operation to perform.
105
119
106
120
This example selects **contains**.
107
121
@@ -111,7 +125,7 @@ This guide shows how to add a condition to your workflow and use the result to h
111
125
112
126
The following example shows the complete condition:
113
127
114
-

128
+
:::image type="content" source="media/logic-apps-control-flow-conditional-statement/complete-condition-standard.png" alt-text="Screenshot shows the Standard workflow and the complete condition criteria.":::
115
129
116
130
- To add another row to your condition, from the **New item** menu, select **Add Row**.
117
131
@@ -121,7 +135,7 @@ This guide shows how to add a condition to your workflow and use the result to h
121
135
122
136
1. In the **True** and **False** action paths, add the actions to run, based on whether the condition is true or false respectively, for example:
123
137
124
-

138
+
:::image type="content" source="media/logic-apps-control-flow-conditional-statement/condition-true-false-path-standard.png" alt-text="Screenshot shows the Standard workflow and the condition with true and false paths.":::
125
139
126
140
> [!TIP]
127
141
>
@@ -167,9 +181,9 @@ The following code shows the high-level JSON definition for the **Condition** ac
167
181
},
168
182
```
169
183
170
-
## Next steps
184
+
## Related content
171
185
172
-
*[Run steps based on different values (switch actions)](logic-apps-control-flow-switch-statement.md)
173
-
*[Run and repeat steps (loops)](logic-apps-control-flow-loops.md)
174
-
*[Run or merge parallel steps (branches)](logic-apps-control-flow-branches.md)
175
-
*[Run steps based on grouped action status (scopes)](logic-apps-control-flow-run-steps-group-scopes.md)
186
+
*[Create switch actions that run workflow actions based on specific values](logic-apps-control-flow-switch-statement.md)
187
+
*[Add loops to repeat actions in workflows](logic-apps-control-flow-loops.md)
188
+
*[Create or join parallel branches with workflow actions](logic-apps-control-flow-branches.md)
189
+
*[Run actions based on group status by using scopes](logic-apps-control-flow-run-steps-group-scopes.md)
0 commit comments