Showing results for 
Search instead for 
Did you mean: 
Community Champion
Community Champion

Extract Archive To Folder: Maintain folder structures?


Is there a way to maintain the folder hierarchy when using the OneDrive for Business- Extract Archive to Folder action? When its used, it flattens all folder hierarchy into a single folder and prepends nested files with `subfolderName_`. This is problematic because naming conventions are critical in the application I'm working on.


Initial .zip folder structure: |---subfolder1 |---file1.txt |---file2.txt |---subfolder2 |---file3.txt |---file4.txt After Extract Archive to Folder action runs: |---subfolder1_file1.txt |---subfolder1_file2.txt |---subfolder2_file3.txt |---subfolder2_file4.txt

I need the folder structure to remain in place. 

Thank you

Dual Super User II
Dual Super User II

Hi @ericonline 


Looks like that might be the default behavior


Your best bet would be to extract and let the structure create itself (flat)


then loop through all files, split name by underscore, and then create folder with the first part of the array of split and then accordingly move the file into that folder

So a long route to achieve your result



Reza Dorrani


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,116)