How to Use Switch Action in Power Automate?

When working on the Power Automate flow, there will be many scenarios to use different kinds of flow triggers and flow actions. If you want to know how Power Automate switch control action works, thoroughly review this post.

In this Power Automate tutorial, I will explain how to use switch action in Power Automate using a simple scenario.

I have implemented a switch statement in Power Automate flow using three switch cases.

Power Automate Switch Case

Power Automate switch condition finds a match for the switch input value and implements the given action.

If the value given in Case1 equals the switch input value, then the first case will execute or check for Case 2.

If the value in case 2 equals the switch input value, then case 2 will execute. Similarly, it continues to check for other cases. But, if none of the cases matches, it will execute the default case.

Note:

Users can add up to 27 switch cases until UI stops under one single Power Automate switch control condition. After that 27th case, Add case will grey out.

Setup SharePoint List

Recently, I got a requirement to use a switch case in a Power Automate Flow. For that, I have researched the Power Automate switch control action.

I will connect a SharePoint list with the Power Automate flow.

For that, I have taken a SharePoint list named ‘Budget List‘ that has different data types as shown below table:

Column NameData Type
Budget PurposeTitle Column – Renamed
Budget TypeChoice Column [Surplus Budget, Balanced Budget, and Deficit Budget, Gender Budget]
Budget AmountCurrency
Used AmountCurrency
Budget ApproverPerson or Group Field
Power Automate Multiple Switch cases

How to Use Switch Action in Power Automate

I will show you how to create a Power Automate automated cloud flow using switch control conditions with multiple cases.

I will take switch input on the SharePoint list column [Budget Type] values.

Switch Cases:

CaseBudget TypeConditionFlow Action
Case 1Surplus Budget Used Amount > Budget AmountSend an email to Budget Approver [Exceeding budget limit]
Case 2Balanced BudgetUsed Amount > Budget AmountSend an email to Budget Approver [Exceeding budget limit]
Case 3Deficit BudgetUsed Amount > Budget AmountSend an email to Budget Approver [Exceeding budget limit]
Default CaseOther Budget TypesSend an email to Budget Approver [Updated Details of Budget]

The screenshot below represents Power Automate flow multiple switch cases:

Power Automate Switch Case Action

Follow the below instructions to create a Power Automate ‘Automated cloud flow’ that will trigger automatically.

  • Open the Power Automate Home page, click on +Create, -> select ‘Automated cloud flow’. Give Flow name, and select trigger ‘When an item is created or modified’ -> Tap Create. Give Site Address and List Name.
  • Then Click on +New step.
Switch Case Function in Power Automate Flow
  • After that, add the Switch condition action. By default, it displays with the switch Case and Default section.
Switch Control condition in Power Automate

Case: 1 [Budget Type = Surplus Budget]

Let’s see the first switch case in a Power Automate flow.

Condition:

If the ‘Budget Type’ is equal to the Surplus Budget, the Used Amount is greater than the Budget Amount => Send an email to Budget Approver [Exceeding budget limit].

Apply a switch input value under switch action as shown below code:

@{triggerOutputs()?['body/BudgetType/Value']}
  • Then, provide Case 1 Equals Surplus Budget manually.
  • Click on Add an action.
Switch Control condition example in Power Automate
  • Add the ‘Condition’ control flow action and provide a condition for case 1 in the condition box.
  • Select Add an action under the ‘If yes’ section.
Choose ValueOperatorChoose Value
@triggerOutputs()?[‘body/UsedAmount’]is greater than@triggerOutputs()?[‘body/BudgetAmount’]
Power Automate Switch statement
  • Add Send an email (V2) under the ‘If yes’ condition and provide the below details:
    • To: Select Budget Approver Email
    • Subject: Specify the subject of an Email
    • Body: Provide details regarding the email as shown below code:
Hello @{triggerOutputs()?['body/BudgetApprover/DisplayName']}
Hope you are doing well!

This email is regarding exceeding of budget amount.The budget amount for@{triggerOutputs()?['body/BudgetType/Value']} is @{triggerOutputs()?['body/Budget_x0020_Capacity']} for the year @{triggerOutputs()?['body/BudgetPassedDate']}.

Note: If it is a emergency purpose,please increase the Budget Amount

Thanks and Regards
Budget Managment Team.
Switch statement using Power Automate

Case: 2 [Budget Type = Balanced Budget]

Let’s add the second switch case in the Power automate flow.

Condition:

If the ‘Budget Type’ is equal to the Balanced Budget, the Used Amount is greater than the Budget Amount => Send an email to Budget Approver [Exceeding budget limit].

Follow the below instructions:

  • Add a second switch case by clicking on the circle with the + icon.
Switch Case of Power Automate
  • After that, provide Case 2 is Equals to Balanced Budget and Click on Add an action.
Switch Condition On Power Automate Flow
  • In the next step, add the ‘Condition‘ control action and set the below condition:
  • Select Add an action under the ‘If yes’ section.
Choose ValueOperatorChoose Value
@triggerOutputs()?[‘body/UsedAmount’]is greater than@triggerOutputs()?[‘body/BudgetAmount’]
Switch Case Function in Power Automate
  • Add Send an email (V2) and enter the below properties:
    • To: Select Budget Approver Email.
    • Subject: Provide a subject for an email.
    • Body: Represents details regarding email as shown below code:
Hello @{triggerOutputs()?['body/BudgetApprover/DisplayName']}
Hope you are doing well!

This email is regarding exceeding of budget amount.The budget amount for@{triggerOutputs()?['body/BudgetType/Value']} is @{triggerOutputs()?['body/Budget_x0020_Capacity']} for the year @{triggerOutputs()?['body/BudgetPassedDate']}.

Note: If it is a emergency purpose,please increase the Budget Amount

Thanks and Regards
Budget Managment Team.
Power Automate Switch Function action

Case: 3 [Budget Type = Deficit Budget]

This is the final case of the Power Automate switch case example I have taken inside the flow.

Condition:

If the ‘Budget Type’ is equal to the Deficit Budget, the Used Amount is greater than the Budget Amount, then Send an email to Budget Approver [Exceeding budget limit].

Follow the below-bulleted points to add switch case 3:

  • Similarly, add Case 3 under the switch control action.
  • Provide Case 3 is Equals Deficit Budget manually.
  • Select Add an action.
Power Automate Multiple Switch Case Conditions
  • Add ‘Condition’ control action under Case 3 and set the condition like below.
  • Next, click Add an action under the If yes’ condition.
Choose ValueOperatorChoose Value
@triggerOutputs()?[‘body/UsedAmount’]is greater than@triggerOutputs()?[‘body/BudgetAmount’]
Multiple Switch Case Conditions in Power Automate
  • Then, add the ‘Send an email (V2)‘ flow action and configure email properties:
    • To: Enter Budget Approver Email Address.
    • Subject: Enter what an email notification is exactly about.
    • Body: Provide detailed information by email as shown below code:
Hello @{triggerOutputs()?['body/BudgetApprover/DisplayName']}
Hope you are doing well!

This email is regarding exceeding of budget amount.The budget amount for@{triggerOutputs()?['body/BudgetType/Value']} is @{triggerOutputs()?['body/Budget_x0020_Capacity']} for the year @{triggerOutputs()?['body/BudgetPassedDate']}.

Note: If it is a emergency purpose,please increase the Budget Amount

Thanks and Regards
Budget Managment Team
Power Automate Switch Control action

Default Case: [Other Budget Types]

This is the default case in Power Automate’s switch control flow action. If all the switch cases fail, it will execute the default case.

Condition:

Budget Type – For other Budget types, Send an email to Budget Approver [Updated Details of Budget].

  • Then, click Default to open a default case and Select Add an action.
How to use Switch case action in Power Automate Flow
  • Add Send an email (V2) action and provide below details :
    • To: Specify the email address Budget Approver.
    • Subject: Specify the subject of an email.
    • Body: Specify detailed information in an email as shown below code:
Hello @{triggerOutputs()?['body/BudgetApprover/DisplayName']},
Hope you are doing well!

Below are the details regarding Budget Amount.

Budget Purpose - @{triggerOutputs()?['body/Title']}
Budget Amount - @{triggerOutputs()?['body/BudgetAmount']}
Budget Type  - @{triggerOutputs()?['body/BudgetType/Value']}
Budget Capacity - @{triggerOutputs()?['body/Budget_x0020_Capacity']}
Requestor - @{triggerOutputs()?['body/Author/DisplayName']}
Budget Description - @{triggerOutputs()?['body/Description']}


Note: If it is a emergency purpose,please increase the Budget Amount.

Thanks and Regards
Budget Managment Team.
Power Automate Flow Switch Condition action
  • Once the flow has been created, Click on Save and select Test.
Switch Case in Power automate
  • In the Test Flow window, Select ‘Manually’ and Click on Test.
Use Switch Action in Power Automate

Now, add an item to a SharePoint list to run the flow.

  • If there are no errors, the flow runs successfully, displays a notification of ‘Your Flow ran successfully, and sends an email.
Power Automate Flow using Switch Statement
  • The images below show generated emails for 3 Power Automate switch cases.
Case 1Case 2Case 3
Surplus Budget – Used Amount > Budget AmountBalanced Budget – Used Amount > Budget AmountDeficit Budget – Used Amount > Budget Amount
Power Automate Switch Multiple cases
How to create multiple switch cases in Power Automate flow
Multiple Switch Cases in Power Automate
  • If none of the cases matches, the switch condition checks for Default Case, runs the flow, and sends an email about updated details of a created item in the SharePoint list.
  • The below image presents an email notification with updated details of the budget for the default case:
Using Switch Condition action in Power Automate

This is how to create a Power Automate flow using switch control action, taking multiple cases.

Conclusion

I hope this tutorial will help you to work on the Power Automate switch control action-taking multiple cases.

I have explained a Switch control action in Power Automate through this Power Automate tutorial. Also, I have demonstrated an example of Power Automate switch action, including three cases and a default case.

Also, you may like some more Power Automate tutorials: