Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

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

(0) ShareShare
ReportReport
Posted on 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 at
    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,067 Super User 2025 Season 1 on at
    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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492