Relative path working in studio but not working in UiPATH app


I have a relative path “downloadedFiles.xlsx” (this file is in the project forlder)…when i run the process from studio the file is recognised and downloaded but when i invoke the process from UiPath app studio by clicking a button the file is not downloaded(nothing is happening). When i put the full path(absolute path) this works perfectly fine when i click a button.

I also tried to use the path as “%userprofile%\OneDrive\StatisticsReportdownloadedFiles.xls” still not working in apps but in studio is working.

My question is the a special way to implement relative in a process to work in UiPath apps studio.

Thank you.

@Lerato_Tsoela do this

Path.Combine(Environment.CurrentDirectory, "downloadedFiles.xlsx")

Hi @jack.chan

I have juat tried the solution you suggested, it is working when i test/debug my process in studio, but still not working in UiPath app studio.

If the click action doesnt do anything in app studio Is it an issue with the click activity instead of the relative path?

I think maybe the is a setting I am missing in UiPath apps when i click the button. What’s surprising the clicks works perfectly fine with absolute path.

Here’s how i solved the problem, i partially used your suggestion also:
i assigned this:
Environment.ExpandEnvironmentVariables(“%USERPROFILE%\Downloads”) to a variable called folderpath, so that it gets the string literal of the path.
And then used this variable and concatenate it to the file name: Path.Combine(var_FolderPath,“Single Field Stats.xlsx”)