Has anyone used 'Resources to Zip' parameter in the Compress/Zip Activity?

Hi everyone,

I’d like to know if anyone was able to pass parameters into the field highlighted in the screenshot below:

To provide some context, this activity is called Compress/Zip and present in the Systems package.

Basically, I want to zip select files present in a given directory using this activity.
I understand there are workarounds like using Invoke code or by transferring those files to another temporary folder and zipping that - I just want to know if its possible to utilize this field to get the job done.

Kind Regards,
Ashwin A.K

@ashwin.ashok
can you try:
{ LocalResource.FromPath("C:\_RPA\_Demo\ZipFiles") }
Value: C:_RPA_Demo\ZipFiles replacement with your folder path

Hi @ashwin.ashok , why not use the ‘Content to Zip’ parameter on the activity? you can provide the path to the file(s) you want to zip using that field.

The ‘Resources to Zip’ takes an IEnumerable parameter. If you have IResources you want to compress/zip, then you could use that field.
The image shows a software code line specifying a generic enumerable collection of a resource interface from the UiPath platform. (Captioned by AI)

Hi @ppr ,

Thank you for your response.
I am unable to find this method - could you please provide some context?

Kind Regards,
Ashwin A.K

Hi @BrianaB ,

Appreciate your response.
I would have used that if it let me add files dynamically - unfortunately it only allows single additions.
Also correct me if I’m wrong, you can’t pass in a list/array of files into that field right?

Kind Regards,
Ashwin A.K

Was introduced later from the UiPath.System.Activities package (try Version level 2024.10.X)
Qualified Access: UiPath.Platform.ResourceHandling.LocalResource.FromPath(...)

Hi @ashwin.ashok , if you want to compress more than 1 file, you could either add each file path manually, or, if you have multiple files you want to compress already located in a folder, you could specify the location of the folder instead of a file, and compress the folder with all files inside by toggling the “Folder” button on the activity.

You could move all the files you want to zip into a folder, then zip the folder.

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