Skip to main content

Fixed: "This Expression Has a Problem" for a Valid Expression in Power Automate

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

Power Automate's expression editor told me This expression has a problem. You can fix it manually or with Copilot. The expression was correct, and the same one worked elsewhere in the flow. Selecting Add again, sometimes two or three times, added it. Once, though, the message was right, and the reason is worth knowing.

What I Was Doing​

I was building the setup flow in Part 11 of the Career Development Plan series. Create the list sends a request body with the new list's title, which comes from the loop the action sits in. In the Body box, after "Title": ", I typed /, chose Insert expression, typed this expression and selected Add:

Expression
items('For_each_list')?['title']

How to Add an Expression in Power Automate shows these steps, and How to Use the items() Function explains the expression.

What I Expected​

The editor to close and a title token to appear in the body.

What I Got​

The editor stayed open, with a red message under the expression:

The expression editor beside the Create the list pane, containing items('For_each_list')?['title'], with the red message This expression has a problem. You can fix it manually or with Copilot. and the button Create an expression with Copilot

What I Checked​

  1. The expression itself. The editor had accepted exactly the same expression in Find the list, a few actions earlier in the same loop. For_each_list is the loop's name with underscores for spaces, and title is a property of each item, as Microsoft's functions reference describes items().
  2. Selecting Add again. On a later try, the editor closed and the token appeared. While I built the flow, the message came back for other valid expressions too, and Add took each of them on the second or third try.
  3. Microsoft's documentation. Classic designer vs. new designer for cloud flows lists known issues with the new designer's expression editor, such as it being slow on large flows. It doesn't describe a correct expression being rejected.
  4. The one time it was right. In a Condition, I typed true as the value to compare with, and the editor flagged it. This time the box didn't say true: it said triggerFormDataMultiValues. The editor shows a list of suggestions while you type, and the keypress after true had accepted the first suggestion in place of my text. That expression really was wrong.

Why It Happens​

Microsoft's documentation doesn't explain the first case. From what I saw, the editor sometimes checks the expression before it has caught up with what's in the box, and checks it again on the next Add. The second case is the editor's suggestion list doing what it's designed to do.

The Fix​

  1. Read the box first. If it isn't what you typed, a suggestion replaced it. Retype it, and press Esc to close the suggestion list before you do anything else.
  2. If the expression is right, select Add again. Two or three tries were enough every time.
  3. If it still won't add, change something and change it back, such as typing a space at the end and deleting it. Then select Add.
  4. Check what was saved. Open the action's Code view and look for the whole expression. A body with an expression inside text shows it as @{...}:
The Title line in Code view
"Title": "@{items('For_each_list')?['title']}"

After the Fix​

The title token sat in the body where the list's name goes, and the flow created both lists with the right names:

The Create the list pane with the Body showing the __metadata type SP.List, BaseTemplate 100 and Title set to the title token

Common Mistakes​

MistakeWhat happensDo this instead
Rewriting a correct expressionYou change something that wasn't wrongSelect Add again first
Pressing Space, Tab or Enter with suggestions openA suggestion replaces your textPress Esc to close the suggestions
Not checking Code viewA wrong or partial expression goes unnoticedCheck the saved expression after Add

Troubleshooting​

SymptomLikely causeFix
A correct expression is flaggedThe editor checked an earlier state of the boxSelect Add again, up to two or three times
The box shows a function name you didn't typeYou accepted a suggestionRetype, press Esc, then Add
The token appears but the run failsThe saved expression isn't what you meantRead it in Code view

FAQ​

Should I use Create an expression with Copilot?​

You can, but it doesn't help when the expression is already correct. Check the box and retry Add first.

Does this happen in the classic designer?​

I built this flow in the new designer only, and the message I saw is the new designer's.

Conclusion​

When the expression editor says This expression has a problem, read what's in the box. If a suggestion replaced your text, retype it and press Esc. If the expression is right, select Add again; two or three tries were enough every time. Then confirm the saved expression in Code view.

Additional Resources​

Stay Updated

Subscribe to our newsletter for the latest tutorials, tech insights, and developer news.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.