cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

Extract Archive To Folder: Maintain folder structures?

Hello,

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.

Example

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

I need the folder structure to remain in place. 

Thank you

1 REPLY 1
Dual Super User
Dual Super User

Re: Extract Archive To Folder: Maintain folder structures?

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

 

Regards,

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

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,441)