web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / an unexpected exceptio...
Power Automate
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

Categories:
I have the same question (0)
  • Verified answer
    Ellis Karim Profile Picture
    12,026 Super User 2026 Season 1 on at

    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.

     

     

  • fiorine Profile Picture
    on at

    Thanks Ellis.  Makes no sense, but it works!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 607

#2
Valantis Profile Picture

Valantis 456

#3
11manish Profile Picture

11manish 352

Last 30 days Overall leaderboard