I am trying to use a switch in power automate based on a department code (the code is a number 1,2,3,4 ect). I think the problem may be with the switch feature. The flow runs and the below is the errors given at Apply to each, Switch, and Case steps in the flow:
Apply to each error:
Action Failed. An action failed. No dependent actions succeeded.
Switch error:
Action Failed. An action failed. No dependent actions succeeded.
Case error:
ActionConditionFailed. The execution of template action 'Post_message_in_a_chat_or_channel' failed: an unexpected exception encountered when evaluating branching condition.
Switch *On should be string or integer.
In the event the case reference is a number that is compared to the Switch *On you will need to convert the *On input to integer. To do this, you use an expression to convert the number to integer. At the Switch *On field, you input this expression:
int(item()['you enter the list column name here'])
This worked for me to solve my problem, as I am pulling a department code selection (the department code is a number 1,2,3,4, ect) from a Sharepoint list column to then drive the Case flow.
Hi @sessionst ,
Please refer to below thread:
Checking if replacing numbers with strings in cases step could solve this issue.
Best regards,
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional