Edit

Share via


"Expression couldn't be evaluated" error when using encrypted text

This article helps you resolve the "Expression couldn't be evaluated" error that occurs when you run a desktop flow with an action that uses direct input.

Applies to:   Power Automate

Symptoms

A desktop flow with an action that uses direct input generates the following error when it's run on a machine different than the one where the flow was created:

Failed with error: Expression couldn't be evaluated

For example,

  • The Direct password input option:

    Screenshot that shows the Direct password input option in a desktop flow action.

  • The Direct encrypted text input option:

    Screenshot that shows the Direct encrypted text input option in a desktop flow action.

Cause

The error occurs because direct inputs are encrypted using the local machine's Data Protection API (DPAPI) and can't be decrypted when the flow is run on another machine.

This limitation is highlighted when you hover over the info icon if any of the direct input options is selected.

Screenshot that shows the tooltip that provides additional information about the limitations of using direct encrypted text or password input.

Resolution

To run the flow on a different machine, modify the flow to use sensitive variables.

  1. Open the desktop flow in Power Automate for desktop.
  2. Locate the action that uses direct password input or direct encrypted text input.
  3. Replace the direct input with a sensitive variable:
    1. Select the Password input as variable or Input as text, variable or expression option to use a variable as a password input or text input.
    2. Choose a variable that's marked as sensitive.
  4. Save the modified flow and test it on a different machine to ensure that the error is resolved.

More information

Use passwords in certain actions within desktop workflows