Using Studio online how do you write a text file to local server


Using Studio online, I am trying to read an attachment on an email and then write a text file to a location on my local server. However any time I create a variable for the server location i am getting an error message. the file location if F:\Shane and the error message that i am getting is that Variable F is missing. Please use Data Manager to recreate it. Does anyone know what steps i need to do to fix this?

Hi @sokeeffe

Studio Web uses specific type of a variable for file interactions so that you can easily pass file resources between different activities.

This does not mean that you cannot access the local file system at all, but it does mean that you need specific steps to do so.

First thing to make sure would be to confirm that you are using your own robot runtimes on your own server to run your automations after you publish your automation. That last bit is crucial because during design time (the screenshot above), Studio Web runs your automations on a UiPath Cloud Serverless runtime unit which has it’s own, temporary storage with no access to your local files.

Now, as to how to access the local file system in the context of Studio Web, you have a few options.

The easiest is to use the Path exists activity, which outputs the file resource. You would do it like so:

If you want a quicker way to get to the file, you can always use this expression as well; it converts a local file path into a resource that you can use in other activities:

LocalResource.FromPath("project.json")

As such, you can indeed use it for your default value like so:
The image shows a variable configuration panel with a variable named "myNewFile" of type "File," scoped to "Main," with the default value set to . (Captioned by AI)

But the most important here is that you will only be able to access your local file paths after you publish, and when you run your automation on a robot with access to those local file paths. The serverless runtime (and thus, the web designer, does not have access to your local file system during designing and debugging of your automation).

EDIT. Here below you can see a small sample from Studio Desktop on how it could look like:


When I would attempt this from a Studio Web designer and debugger, it will rightfully fail because I had no access to my local file system (even though I am running both automations from the same computer right now).

However, if I then publish my Studio Web automation and run it from my Assistant - it will work, because my assistant processes would then trigger on the robot that is on my local machine, which does have access to this file :slight_smile:

I wanted to add that Studio Web has recently released to the Community the ability to debug with the local robot. Meaning that you can build and test automations using your local machine instead of our cloud robots.

To use your local machine, simply select Local machine from the dropdown menu of the test button.
The image shows a dropdown menu in the UiPath Studio interface, indicating options to test the environment either "On local machine" or "On cloud," with "On cloud" selected. (Captioned by AI)

1 Like

Thanks for your help, I will try this to see if it works for me.