Auto remove "OUTPUT_DIR" folder in Robocorp Studio

Hi all,

I ran a sequence that stores HTML as a PDF file, but I got an error. My sequence automatic removes the output folder with “OUTPUT_DIR” path.

I developed in Robocorp Automation Studio the newest version
Code:

Html To Pdf ${results_html} ${OUTPUT_DIR}${/}${order_number}.pdf

image

Please help me!!!

Regards,
Chinh

Can you share your robot.yaml file? Maybe there it has a different path for the output

Hi aleantunes95,

robot.yaml file below:

tasks:
  Order robots from RSB:
    robotTaskName: Order robots from RSB
  Test:
    robotTaskName: Test
condaConfigFile: conda.yaml
ignoreFiles:
- .gitignore
artifactsDir: output
PATH:
- .
PYTHONPATH:
- .

I’ve just tested and seems running robot from Studio creates file under automation-studio\artifacts\run-id
. You should be able to access files after run by
image

P.S. If you are following lvl2 course it probably behaves differently, as course uses VSCode

Thank you, @linkraivo
I know it. So I ask the question. I want to save the file in “output” folder, not artifacts. Is a RBC studio bug?

Can you add following into your robot, and verify from log where that actually points?

Log    Output directory is: ${OUTPUT_DIR}    WARN

And if you remove that folder, make sure that something also actually creates that folder.

I trace the Log and not remove anything. I’m sure that “output” folder is still available before I run the robot.

What was output of that Log keyword from my previous reply?

Also, can you share your real code, so that we can see what you are actually doing?

Hi @jippo

Run task name: Test
Robot designed by Robot Studio

My source here:
certlevel2.zip (92.4 KB)

Can you please check (and report) what is output of above Log in your machine, in your robot run, in your Automation Studio, right before pdf exporting?

Hi,

The current of implementation of Automation Studio moves the files from the output directory to artifacts, to prevent runs from affecting each other and to have a history of runs. The output directory exists during the run, but is deleted right after it.

On second thought, this is probably not what should happen. I changed the implementation to delete the output directory only when a new run is started. It’ll be fixed in the next release.

1 Like

That is the answer.

Thank you very much