HOW DO I MAKE MY PATH RELATIVE SO THAT ANY USER CAN USE THE ROBOT ONCE I PUBLISH IT

  1. I am downloading two files from the Storage bucket.
  2. Saving it to my location.
  3. Comparing them and saving the unmatched records to a different Excel and performing some actions.
  4. I want to make the path relative, so the user doesn’t have to change the path in the config file.
    HOW DO I MAKE MY PATH RELATIVE SO THAT ANY USER CAN USE THE ROBOT ONCE I PUBLISH IT.

@Dimple_Mandal

In that case, File should be inside project folder. And then you can pass Relative file path instead of Absolute file path.

Can you help me out with a small example?Saving it after downloading and reading it from the same folder

Hi Dimple ,

Can you try as used in this post .

Environment.GetEnvironmentVariable(“userprofile”)+"\Downloads"
getting error message,
Download Storage File: Could not find a part of the path ‘C:\Users\xyz\Downloads’.

1 Like

Hi
Hope the below steps would help you resolve this

  1. Have two folders in your project folder

  2. Name One of the folders as Input and
    Another one as output

  3. Now once while down loading the saving the file mention the file path as “Input\”
    So that it gets saved in that folder

  4. Now while reading the file for that Input folder
    First use a assign activity like this

strfilepath = Directory.GetFiles(“Input”)(0).ToString

  1. Pass this string variable strfilepath as input to excel application scope and read it with read range

  2. Now you will be having the data in a data tale and write it with WRITE RANGE activity from workbook activities and mention the file path like this
    “Output\”+”anyname you want”+”.xlsx”

  3. This will now get saved in output folder

  4. Then we can use DELETE FILE activity where pass the input as Strfilepath

Cheers @Dimple_Mandal

  1. Now while writing
1 Like

I will try this,Thankyou

@Palaniyappan So this will work once I publish this from orchestrator and then the user runs from any system.

Yeah @Dimple_Mandal
Because it’s inside the project folder only
Even when ran by others the folders are still accessible being inside the project folder

@Palaniyappan


I am getting this error once I publish it to Orchestrator. But it works fine while I Run it from Studio.

Try opening that machine and run it from robot assistant instead of studio and see how it works

@Dimple_Mandal

I am working from the same machine and tried to run from Assistant as well, but it is giving the same error. @Palaniyappan

It is throwing an error while downloading the file, the location for which the error is coming up is different from the working project location.

So what i did to fix it is, since initially the folder that i created in my workspace to save the downloaded file, was not getting created in the error path(C:\-----), i manually created a new folder with the same name over there and now it is running

Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)+"\Downloads"

1 Like

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