Using Image Variable


I use the “Take Screenshot Activity” and I would like to store the “image” that it returns in a certain folder. I would also like to rename the “image” to a different name so that it corresponds to the current date and time and then store the file path to that image in a data table. I am confused on how to move that image into a certain folder and then rename the file.

Thank you in advance for your help!

you should use UiPath.Core.Activities.SaveImage.
There are two inputs:

  1. FileName - where you specify the name of the saved file
  2. Image - image variable that you want to save.


Okay, where is the file saved by default? How could I move it into a specific folder?

There is no by default. You provide the full path and filename to the Save Image activity.

1 Like

I am using the file path below
“”\micolfs\shared\UIPath\LegalBillingEntry\ErrorScreenshot" +System.DateTime.Now.ToString(“dd-MM-yyyy hh:mm:ss”)"

and the file path before the “+” does exist but I am getting the error message

“Save Image: Save image failed. Check if the file name is a valid path”

After the “+” is the desired name for the image. Do you know why I am getting this error?

If after the + is the desired name for the image, then you need another \ after ErrorScreenshot.

The result of your expression is:

\micolfs\shared\UIPath\LegalBillingEntry\ErrorScreenshot06-17-2021 03:15:25

That’s not a path and filename, that’s just a path. You’re missing the file extension, also.

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