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

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: