|
| 1 | +--- |
| 2 | +title: Expression Couldn't be Evaluated Error When Using Encrypted Text |
| 3 | +description: Provides a resolution for the Expression couldn't be evaluated error when using direct encrypted text in Power Automate for desktop. |
| 4 | +ms.reviewer: iomavrid |
| 5 | +author: yiannismavridis |
| 6 | +ms.author: iomavrid |
| 7 | +ms.date: 02/18/2025 |
| 8 | +ms.custom: sap:Desktop flows\Power Automate for desktop errors |
| 9 | +--- |
| 10 | +# "Expression couldn't be evaluated" error when using encrypted text |
| 11 | + |
| 12 | +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. |
| 13 | + |
| 14 | +_Applies to:_ Power Automate |
| 15 | + |
| 16 | +## Symptoms |
| 17 | + |
| 18 | +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: |
| 19 | + |
| 20 | +> Failed with error: Expression couldn't be evaluated |
| 21 | +
|
| 22 | +For example, |
| 23 | + |
| 24 | +- The **Direct password input** option: |
| 25 | + |
| 26 | + :::image type="content" source="media/error-expression-could-not-be-evaluated/direct-password-input.png" alt-text="Screenshot that shows the Direct password input option in a desktop flow action."::: |
| 27 | + |
| 28 | +- The **Direct encrypted text input** option: |
| 29 | + |
| 30 | + :::image type="content" source="media/error-expression-could-not-be-evaluated/direct-encrypted-text-input.png" alt-text="Screenshot that shows the Direct encrypted text input option in a desktop flow action."::: |
| 31 | + |
| 32 | +## Cause |
| 33 | + |
| 34 | +The error occurs because direct inputs are encrypted using the local machine's [Data Protection API (DPAPI)](/dotnet/standard/security/how-to-use-data-protection) and can't be decrypted when the flow is run on another machine. |
| 35 | + |
| 36 | +This limitation is highlighted when you hover over the info icon if any of the direct input options is selected. |
| 37 | + |
| 38 | +:::image type="content" source="media/error-expression-could-not-be-evaluated/encrypted-tooltip.png" alt-text="Screenshot that shows the tooltip that provides additional information about the limitations of using direct encrypted text or password input."::: |
| 39 | + |
| 40 | +## Resolution |
| 41 | + |
| 42 | +To run the flow on a different machine, modify the flow to use [sensitive variables](/power-automate/desktop-flows/manage-variables#sensitive-variables/power-automate/desktop-flows/manage-variables#sensitive-variables). |
| 43 | + |
| 44 | +1. Open the desktop flow in Power Automate for desktop. |
| 45 | +1. Locate the action that uses direct password input or direct encrypted text input. |
| 46 | +1. Replace the direct input with a sensitive variable: |
| 47 | + 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. |
| 48 | + 1. Choose a variable that's marked as sensitive. |
| 49 | +1. Save the modified flow and test it on a different machine to ensure that the error is resolved. |
| 50 | + |
| 51 | +## More information |
| 52 | + |
| 53 | +[Use passwords in certain actions within desktop workflows](/power-automate/desktop-flows/how-to/use-passwords) |
0 commit comments