Convert into Zip

Hi guys,

I have a variable of Datatype - List (of String) which contain pdf file path (May contain one or multiple files in that variable).

I want to covert that files into zip file.
If it contain one or multiple file it should convert that file into one zip file.

Use a for each loop and pass the list of string variable and inside for each loop use compress zip file and pass the currentitem variable of for each loop and provide the path where you want to save the zip file.

Mark it as SOLUTION if this is Needful

Happy Automation

Hi @Gokul_Murali

Use for each activity to loop all the files in folder. Inside For each use Compress/Zip files activity. Pass the currentitem variable of for each as a filename. Provide a output variable in which out get the zip file.

Thanks!!

@Gokul_Murali,

Pass the list like this into Resources to Zip property of Compress/Zip Files activity.

yourListVariable.Select(function(x) LocalResource.FromPath(x))

1 Like

@ashokkarale

Iam getting an error like this

@Gokul_Murali,

The Compressed file name is my project specific. Make sure that file path "Output\Zipped File.zip" is available in your project. Looks like you don’t have the Output folder available in your project.

@ashokkarale

Iam having that folder in my project

but that Output folder is in Data Folder so you should use Data\Output\Zipped File.zip

1 Like

@ashokkarale

I didn’t add “Data” folder like below

“Data\Output\Zipped File.zip”

@Gokul_Murali,

In your case it should be like Data\Output\Zipped File.zip

You didn’'t Add data but the Output folder is in Data folder so the it should be Data\Output\Zipped File.zip

If this needful mark it SOLUTION

Happy Automation

@ashokkarale
@bhavesh.choubey
@sarvesh.b

Thank you so much guys

@ashokkarale solution is marked

2 Likes

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