Absolute path not recommended use relative path Instead

Hi team,

Am getting an warning in ReadtextFile under System activity saying absolute path not recommended use relative path instead that is not including a drive letter or root folder.

Please advise me on this.


Hi @ydhanabalan

The read text file activity will accepts only relative path. I think you have given the absolute path.

The absolute path means it will take the path from the root folder like “C:\Folder\Subfolder\file.txt”

The relative path means the current working directory is “C:\RootFolder” , and the file to be accessed is located in “C:\RootFolder\Folder\file.txt” . To reference this file using a relative path, you would only specify: “Folder\file.txt”

Hope it helps!!


You would have hardcoded the path in read text…that is the reason you are getting that warning…

Basically if you are using paths which contains username in it …when you run on other machiens they would fail…so this is not recommended and instead we can use variable in the path or relative path where we dont need to specify those details or the details ar wspecified dynamically…

Relative path in the sense the path would be relative to the project for example if a file is present in the roject folder where main.xaml is presnet the. We can give the relative path as the filename directly and it would read it

Hope this helps


When I corrected this issue, i got another one as object reference not set to an instance of an object. where do I make an error ? Please advise


As per error looks like you used a variable and the variable is empty or is null …please check if you gave a value to it


1 Like

Check the output variable is created or not. Check any data exist in the file or not. @ydhanabalan

1 Like

yes I missed to declare the correct variable, now it works, thanks


If you find the solution for you query. Make mark it as solution which helps to other forum members.

Note - UiPath forum will allows to give solution to one solution only.

Happy Automation!!

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