Use a condition to specify that a cloud flow performs one or more tasks only if a condition is true or false.
The Switch function evaluates a formula and determines whether the result matches any value in a sequence that you specify. If a match is found, a corresponding value is returned. If no match is found, a default value is returned. In either case, the returned value might be a string to show, a formula to evaluate, or another form of result.
If and Switch are very similar, but you should use the best function for your situation:
In this lab, you will create a cloud flow using a Power Automate to work with conditions and switch functions.
Learning objectives
- Conditions and SwitchesDuration
- 30 minutesScenario
- Send an email based on the conditions and switches on when a an item is created or modified in a SharePoint list.Prerequisites
- Each student must have a dedicated custom SharePoint list named Work Progress Tracker. This list was already created during the basic flow lab.a. Create an automated cloud flow called Conditions Demo and the trigger would be When an item is created or modified (SharePoint list)
b. Configure the SharePoint trigger:
c. Add a new condition - if Priority Value is equal to High OR Priority Value is equal to Medium.
d. Add a __Send an Email(v2) action for the True and False Branches:
e. Save and Test the flow.
a. Modify the condition - if Priority Value is equal to High AND Progress Value is equal to Not started.
b. Save and Test the flow.
a. Modify the condition - if Progress Value is equal to Blocked AND if Priority Value is equal to High OR Priority Value is equal to Medium
b. Save and Test the flow.
a. Replace the If condition with a Switch statement of the Priority Value
b. e. Save and Test the flow.