Relative Path Solution needed

Hello Team,

iam not a rookie but i cannot post in other Topics. But maybe it is a Rookie Topic.

In our Team we develop many workflows for several Projects.

The Problem we have. If we use the predefined relative paths from Framework. We run often in an error.

Error appears when we use external absolute path or when the Robot works on other applications like SAP outside of the project folder.

!! We know how to solve this. With a Path variable at the beginning.!! (current directory)

But the Problem is at this point you cannot use the import arguments feature.

Is there a posibility now or in future that we can use relative path in Projectfolder without errors.?

Or with variable path and keep the import argument features?

sry for my english

best regards

Bernd

Use a string variable for the path folder then use Path.Combine(PathFolder +“Folder/File.xaml”)

Arguments are kept - you will need to import arguments with the direct filepath before using the above.

1 Like

yeah thx as i said we make it that way already. But as you said you only can import before. When u add arguments after you have to type each argument by hand.

So my question is still open. Is or will be a possibility to keep the relative path or use variable and the import function can work at any time?

Yes, this is possible to do.

  1. Set the Project path
    Home > Settings → Locations - Project Path
    i.e. C:\Users\ UserName \Cloud\OneDrive\Documents\UiPath\Automation-Demo

  2. Change your project file references:
    i.e. IO.Directory.GetCurrentDirectory +“\Reports\Vendor-Report-Template.xlsx”

Explanation:
We concatenate the Project Path and relative path references under the project. If you now move the project to another user you update the Project Path

Stay safe and well.
T.