Hello everyone!
I have read some topics regarding the question I have, however it is not a 100% clear to me, since I am pretty new to UiPath.
So, I would like to ask you, guys, how do I assign a dynamic file path?
The robot opens an Excel file and takes some data from it, but the file should be able to be open from every computer.
Iโd appreciate some help!
This will get the specific UserProfile dynamically
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)+"\Downloads"
Environment.ExpandEnvironmentVariables("%USERPROFILE%\Downloads")
Regards
Gokul
1 Like
Updated the expression to get the excel files also inside the folder
Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)+"\Downloads\","*.xlsx")
Regards
Gokul
2 Likes
If your files will be inside your project folder you can use
Environment.CurrentDirectory+"\Folder name or Filename.xlsx"
Regards
Sudharsan
1 Like
Thank you all for the help!
I will try to do it both ways!
This will get all the files inside the folder contains XLSX and also every computer. Let us know, if do you face any issue.
Regards
Gokul
Thank you, but an error occurs, I canโt understand exactly why - "Value of type 1-dimensional array of string cannot be converted to string.
1 Like
Thank you very much, it worked!
1 Like
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.