cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
schuess3
Kudo Kingpin
Kudo Kingpin

A switch inside of a condition inside of a apply to each

Have you ever come across this or do you have some insight for me?

 

Background

I have an apply to each evaluating rows of an excel table.

I have a condition inside of that apply to each that checks if a date column equals today

If the condition is met, there is a switch condition that looks at a status value and then performs an action

 

schuess3_0-1654808772252.png

 

 

Problem

No matter what i put in a switch case, it fails with the following error message

 

"ActionConditionFailed. The execution of template action '[ACTION NAME HERE]' failed: an unexpected exception encountered when evaluating branching condition."

 

Again, no matter what i put under the switch case it fails. 

 

THoughts? @faustocapellanj @Pstork1 @Flownaut @RezaDorrani @Shanescows 

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

I have nested switches inside conditions inside Apply to Each loops so its definitely possible.  Looking at your screen shot I suspect the problem may be your evaluation condition.  Switch is built to work by evaluating a string, but it looks like the value comes out as an integer.  Have you tried making sure that you end up with a string and not a number?



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
Pstork1
Dual Super User
Dual Super User

I have nested switches inside conditions inside Apply to Each loops so its definitely possible.  Looking at your screen shot I suspect the problem may be your evaluation condition.  Switch is built to work by evaluating a string, but it looks like the value comes out as an integer.  Have you tried making sure that you end up with a string and not a number?



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
schuess3
Kudo Kingpin
Kudo Kingpin

Well @Pstork1 you pretty much nailed it. I guess it is too much to ask for a message that says "expecting string, but received integer instead" 🙂

 

As a recap, if you are using a switch condition, and you want to put a numeric character like 1, 2, or 3, the switch condition seems to evaluate down the correct path, but then throws an error. Apparently, you need to put a text string in the case.

 

Thanks for your help.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,126)