web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Automatically Zip indi...
Power Automate
Answered

Automatically Zip individual subfolders of a folder and save them separately

(0) ShareShare
ReportReport
Posted on by 4

I'd like to zip all the subfolders of a folder in individual zip files, but the flow I've created keeps failing, with the error not giving any details beyond “Failed to zip files”

 

 

WeRun_0-1665173906178.png

 

 

The flow is basically
1) get all the subfolders inside the folder.

 

WeRun_1-1665174086999.png

WeRun_2-1665174145950.png

 

 

2) Loop through each entry of the array

WeRun_3-1665174177350.png

 

 

2.1) Zip the specific entry of the array

WeRun_4-1665174195117.png

 

 

WeRun_5-1665174226118.png

 

 

Can someone help me figure this out?

 

Here's the full log

 

: Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException: Failed to zip files
 at Microsoft.Flow.RPA.Desktop.Modules.Compression.Actions.ZipFiles.Execute(ActionContext context)
 at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

 

 

 

  • Verified answer
    MichaelAnnis Profile Picture
    5,727 Moderator on at

    First, does %FolderPath% happen before Get subfolders?  You use it in get subfolders, so it has to be declared and correct before then.

     

    Second the end of the loop is at %Folders.Count - 1%.  Since it is 0 index, everything is -1.

     

    For archive path, just try %FolderPath%\%Folders[LoopIndex].Name%.zip and for Files to zip, try %Folders[LoopIndex]%

     

    Good luck!

     

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 211 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 190

Last 30 days Overall leaderboard