Get environment folder activity

Hi,
Why do I have to use “Get environment folder” in specifying the file path. Can I use relative file path?
For example “MyWorkingFolder\CodeFiles\Input.xlsx” for Use Application Browser.

Do I have to use MyEnvironment + “\MyWorkingFolder\CodeFiles\Input.xlsx”

Thank you,

Hi @A_Learner

Get Environment Folder allows for a standardized approach across different environments. However, you can use relative file paths in some cases, like your example MyWorkingFolder\CodeFiles\Input.xlsx if the file is within the project directory.

Just ensure the path is correctly specified based on your project structure.

Hope this helps,
Best Regards.

@A_Learner,

You can use both approaches as per your choice. There is no right/wrong.

Thanks,
Ashok :slight_smile:

@A_Learner

You can use both…natively in UiPath activities relative path also would work…but when you write an invoke code or use any 3rd party activities relative pth might not work…at that time you would be interested in getting the current environment path and append with relative pth to make the fullpth and use it

Also while joining using path.combine is recommended rather than direct +…path.combine will take care of extra or missing slashes in the pth

Cheers

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.