Skip to main content
Community site session details

Community site session details

Session Id : C2405mG01ZH/2nhwboDYsb
Power Automate - Building Flows
Answered

an unexpected exception encountered when evaluating branching condition (swith statement)

Like (0) ShareShare
ReportReport
Posted on 9 Oct 2021 11:29:12 by

I'm trying to create a flow with the dataverse connector.  I want to give read access to a team if a connection is made to a property or account.  So I want to find the id of the connected from and the type and based on that I have a switch on the type and inside the switch I do a get record by id.  I have tried adding the connected from(value) in the row id or a string variable with the ID and I keep getting the unexpected exception error.  If I  run the get record by id outside of the switch statement it works without issue. Anyone have any idea of what could cause this.  If not I will have to rewrite all the code with if statements.

Thanks,

Glenn

Screenshot 2021-10-09 072408.jpg

  • fiorine Profile Picture
    on 21 Oct 2021 at 13:56:17
    Re: an unexpected exception encountered when evaluating branching condition (swith statement)

    Thanks Ellis.  Makes no sense, but it works!

  • Verified answer
    Ellis Karim Profile Picture
    11,177 Super User 2025 Season 2 on 10 Oct 2021 at 11:46:59
    Re: an unexpected exception encountered when evaluating branching condition (swith statement)

    Try converting the variable entitytype to integer:

    2021-10-10_12-36-51.jpg

    It seems that the Switch actions can't distinguish between and integer and a string.

     

    Don't try this: Enclosing the value in quotes - as this seems to be a bug:

    2021-10-10_12-46-09.jpg

    2021-10-10_12-49-47.jpg

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

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete