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 / Help Unzipping multipl...
Power Automate
Unanswered

Help Unzipping multiple files from folder

(0) ShareShare
ReportReport
Posted on by 52

I got the situation of unzipping  many files from folder.

I have created the flow but from 20 files unzips only 5 .

I noticed that part of them has same file name, so somehow the flow unzipped only unique names.

Could you help ?

  • CU16071609-1 Profile Picture
    6,255 Moderator on at

    @EdiSM 

     

    Please share some screenshot of your folder

     

     

  • EdiSM Profile Picture
    52 on at

    ZIP in folders.pngExcel file in zip.png

  • VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @EdiSM ,

     

    Please find the solution.

     

    VishnuReddy1997_0-1716290607991.png

     

    Code:

     

    FUNCTION Unzip GLOBAL
     Folder.GetFiles Folder: $'''C:\\Users\\OneDrive\\Desktop\\Power Automate Desktop\\Practice\\Zip''' FileFilter: $'''*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
     LOOP FOREACH CurrentItem IN Files
     Compression.UnzipFiles ArchivePath: CurrentItem.FullName DestinationFolder: $'''C:\\Users\\OneDrive\\Desktop\\Power Automate Desktop\\Practice\\PDF\\Output'''
     END
    END FUNCTION

     

    (Note:- if you got your solution you can mark as solution and gives kudos)


    Thanks & Regards

    Vishnu Reddy

     

  • EdiSM Profile Picture
    52 on at

    Hi , 

    it's the same thing as I did , so if  there are 2 excel file with the same name, Unzip  takes into consideration only 1, so will unzip only 1.

  • CU16071609-1 Profile Picture
    6,255 Moderator on at

    @EdiSM 

    Please find the below approach for the same. Pls fine tune as per your requirement.

     

    Deenuji_0-1716291977652.png

     

    Folder.GetFiles Folder: $'''C:\\Boot\\xslx\\''' FileFilter: $'''*zip''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
    SET Counter TO 1
    LOOP FOREACH CurrentItem IN Files
     Compression.UnzipFiles ArchivePath: CurrentItem.FullName DestinationFolder: $'''C:\\Boot\\xslx\\Unzip\\%Counter%'''
     SET Counter TO Counter + 1
    END
    Folder.GetFiles Folder: $'''C:\\Boot\\xslx\\Unzip''' FileFilter: $'''*xlsx''' IncludeSubfolders: True FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
    SET Counter TO 1
    LOOP FOREACH CurrentItem IN Files
     Text.SplitText.SplitWithDelimiter Text: CurrentItem.Name CustomDelimiter: $'''_''' IsRegEx: False Result=> TextList
     File.RenameFiles.Rename Files: CurrentItem.FullName NewName: $'''%TextList[0]%_%Counter%''' KeepExtension: True IfFileExists: File.IfExists.DoNothing RenamedFiles=> RenamedFiles
     File.Move Files: RenamedFiles Destination: $'''C:\\Boot\\xslx\\New folder''' IfFileExists: File.IfExists.DoNothing MovedFiles=> MovedFiles
     SET Counter TO Counter + 1
    END

     

     

    My folder looks like this:

    Deenuji_1-1716292182442.png

     

    Output:

    Deenuji_2-1716292231983.png

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • EdiSM Profile Picture
    52 on at

    But my issue is that mines have same name , I'm referring as result ( in your last picture) , ZPPMD04_1111.

    so what if you have 10 files with name ( inside the zip ) ZPPMD04_1111 ?

  • VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @EdiSM ,

     

    Can you share the screenshot of your flow and can you ellabrote the issue.

     

    Regards,

    Vishnu Reddy

  • CU16071609-1 Profile Picture
    6,255 Moderator on at

    @EdiSM 

     

    It's guaranteed to work; I've specifically designed the bot to function this way. Don't worry; just give it a try and inform me of the results.

     

    You can't maintain all the Excel files with the same name, right. That's why I've trimmed the first few characters of each Excel file name and added a counter as a suffix. That's why it's displaying like that in the output.

     

    Deenuji_0-1716292917131.png

     

    Code:

    Folder.GetFiles Folder: $'''C:\\Boot\\xslx\\''' FileFilter: $'''*zip''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
    SET Counter TO 1
    LOOP FOREACH CurrentItem IN Files
     Compression.UnzipFiles ArchivePath: CurrentItem.FullName DestinationFolder: $'''C:\\Boot\\xslx\\Unzip\\%Counter%'''
     SET Counter TO Counter + 1
    END
    Folder.GetFiles Folder: $'''C:\\Boot\\xslx\\Unzip''' FileFilter: $'''*xlsx''' IncludeSubfolders: True FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
    SET Counter TO 1
    LOOP FOREACH CurrentItem IN Files
     Text.SplitText.SplitWithDelimiter Text: CurrentItem.Name CustomDelimiter: $'''_''' IsRegEx: False Result=> TextList
     File.RenameFiles.Rename Files: CurrentItem.FullName NewName: $'''%TextList[0]%_%Counter%''' KeepExtension: True IfFileExists: File.IfExists.DoNothing RenamedFiles=> RenamedFiles
     File.Move Files: RenamedFiles Destination: $'''C:\\Boot\\xslx\\New folder''' IfFileExists: File.IfExists.DoNothing MovedFiles=> MovedFiles
     SET Counter TO Counter + 1
    END

     

    How to copy/paste the above code into your power automate desktop?

    Deenuji_0-1716293152758.gif

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

     

  • EdiSM Profile Picture
    52 on at

    Copy + paste as you wrote , but still the same issue.

    From  24 zip files, flow unzip only the unique names for the files.

    In order to work, maybe to open each zip , to select the excel file and rename it, and then to unzip all the files.

  • CU16071609-1 Profile Picture
    6,255 Moderator on at

    @EdiSM 

     

    Please share the screenshot of your flow and results.

     

    If possible, please ping me in linkedin. We will discuss and close this.

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 249 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 198

#3
David_MA Profile Picture

David_MA 197 Super User 2026 Season 2

Last 30 days Overall leaderboard