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 / Switch or If statement...
Power Automate
Answered

Switch or If statements either give "statement couldn't be evaluated" or don't go down the expected path

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi

I am using a very simple If statement with "Starts with" that throws ""statement couldn't be evaluated".

If I change it to "Contains" no error is thrown but it evaluates as false when it's true.

So, I switched to a "Switch" statement (no pun intended) and I get the same results.

I then tried setting a variable rather than using a literal comparing one variable with another and I get the same result.

Below is a screenshot of the code. Notice that I display a message to make sure that the data is correct.

This is driving me nuts. Any assistance will be appreciated.

Thanks, Mark.

 

Gemtech_0-1657765030119.png

 

I have the same question (0)
  • Verified answer
    VJR Profile Picture
    7,635 on at

    See if either of the variables have any invisible characters like a newline or a tab and remove them.

     

    VJR_0-1657770087823.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @VJR 

    Many thanks for your suggestion.

    I used "contains" and it now works.

    Many thanks 🙂

    Have a great day.

    Regards, Mark. 

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 442

#2
Vish WR Profile Picture

Vish WR 328

#3
David_MA Profile Picture

David_MA 268 Super User 2026 Season 1

Last 30 days Overall leaderboard