Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

Most common reasons for an invalid expression in Power Automate

Posted on December 26, 2021August 23, 2022 by Tom

“Power Automate editor tells me that “The expression is invalid” but it doesn’t tell me what’s wrong, how can I fix it?”


“The expression is invalid”. That’s all the information you receive when adding an expression to your flow. But why is it invalid? Which part of the expression must be fixed? What are the most common causes of an invalid expression? This post describes the problems I see all the time.

Power Automate invalid expression

Wrong single quote character

All the expressions use the same separators – a comma between parameters, and single quotes to define parameter values. The single quote must be always a specific character, the one used in the designer:

'

If you copy the expression from a page that uses a rich text editor, it might show a different one, e.g.

‘

It’s a small difference from the user perspective, but a big difference from Power Automate point of view.

formatDateTime(utcNow(),'yyyy-MM-dd')   - OK
formatDateTime(utcNow(),‘yyyy-MM-dd’)   - NOT OK

Single quotes around expression or dynamic value

The single quotes should be used only if you type in a value as a parameter. If you use dynamic content or another expression in an expression, it must be without the quotes.

formatDateTime(utcNow(),'yyyy-MM-dd')           - OK
formatDateTime('2021-12-26','yyyy-MM-dd')       - OK
formatDateTime(outputs('Compose'),'yyyy-MM-dd') - OK
formatDateTime('utcNow()','yyyy-MM-dd')         - NOT OK (even though the editor will accept it)
formatDateTime(2021-12-26,'yyyy-MM-dd')         - NOT OK

Too many or too few single quotes

The single quotes must be always in a pair. If there’s a single quote before the value, there must be exactly one after the value too.

Missing or misplaced closing brackets

The same applies also to brackets. Each expression must have an opening and a closing bracket, and they must be at the right place, after all the parameters. If you build a complex expression, e.g. as in the post on extracting previous SP column values, it’s easy to get lost in the brackets. That’s when you should use a good code editor – I personally use Visual Studio Code.

If you enter the expression in the editor, it’ll highlight the corresponding brackets. That helps a lot to identify if you have all the brackets, and if they’re in the right place.

The flow editor whim

The problem I encounter most often myself is the editor whim. When I enter the expression, it’ll state that the expression is invalid. But only on the first try, after one copy/paste it’ll accept the expression as it is. Sometimes it just needs two attempts instead of one.

Summary

As you can see, there’re multiple reasons why Power Automate can give you “The expression is invalid” error message. But if you follow the points in this post, you should be able to identify the problem and quickly fix it.


🚀 Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

🚀 Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Working on an Approval process?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy a fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundle—everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes