Announcements
I've created a variable storing the profile username and I want to reference the variable inside of a file path, but I'm getting an error message. When I hard-code the profile username into the file path the file opens successfully. I realized it's because the file path is line breaking after the variable, is there a way to fix this so I can include the variable inside the file path?
File path: C:\Users\%variable%\Downloads
Error message: Illegal characters in path.: Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK.ActionException: Failed to read text from file C:\Users\sesa0000\Downloads ---> System.ArgumentException: Illegal characters in path.
Hi @tgut03 ,
This looks correct. The way to make this work is to put that into a compose action, and create your dynamic file path there. Then when you refer to the path, you refer to the output of the compose action.
Use the get windows environment variable action and select username. Set the variable equal to the environment variable value and the file path opens successfully.
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 231 Super User 2026 Season 2
David_MA 217 Super User 2026 Season 2
Mohsin Ali 170