cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
VitorBart
Regular Visitor

How to automatically extract zip files created by my own flow?

Good evening everyone.

 

I apologize if this has been answered before, I've been searching around for a while with no luck, tough. 😞

 

I've built a flow that whenever a file is added to my business SharePoint folder, this new file gets automatically copied to my business OneDrive folder as a backup measure. However, I haven't been able yet to make it that whenever a new .ZIP file is created, it gets copied to my OneDrive folder and also gets unzipped.

 

The template I built is shown above. Whenever a new file is created into one specific folder from my company's SharePoint, the flow creates a folder with a name related to today's date and then saves it there. But what else should I do in order that the flow also unzip the ZIP files it eventually copies??

 

<EDIT>: Just out of curiosity, this flow already works fine except for the non-auto-extracting routine. I've noticed this little weirdness: the zip files that the flow copy from Sharepoint to OneDrive are not recognized as regular zip files by 7zip at first, I have to manually open them with 7zip and only then 7zip recognizes them as "compressed folder" files so that I can unzip them. Kinda weird...

 

VitorBart_0-1632080325869.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
VJR
Memorable Member
Memorable Member

Hi @VitorBart 

 

I guess the issue is causing because the second parameter is expecting a Folder whereas in below screenshot it appears to be the zip file itself. Try just giving the folder path.

 

VJR_0-1632114502107.png






-------------------------------------------
Help fellow beings find relevant posts.
Upvote to a supporting response.
Mark as solution to an answer.

View solution in original post

eric-cheng
Solution Sage
Solution Sage

Hi @VitorBart ,

 

Tried the below and it appears to be working as expected.

 

ericcheng_0-1632132063951.png

 

Can you also ensure you are passing the actual filename in the following parameter?  Your action before is creating the file as the 'Name' parameter.  Do you have it after your formatDateTime()?  

 

If so, can you share it?

 

ericcheng_1-1632132146340.png

 

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

 

View solution in original post

10 REPLIES 10
eric-cheng
Solution Sage
Solution Sage

Hi @VitorBart ,

 

Are you already using the extract actions below to unzip compressed files?

 

 

ericcheng_0-1632098487591.png

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

VitorBart
Regular Visitor

Actually, this is what I did try but does not seem to work at all.

 

After being copied to my Onedrive folder, the zip file is supposed to be extracted to its folder (the folder where the ZIP file already is) but nothing happens after the zip file is created.

VitorBart_0-1632108722496.png

tkz!

VJR
Memorable Member
Memorable Member

Hi @VitorBart 

 

I guess the issue is causing because the second parameter is expecting a Folder whereas in below screenshot it appears to be the zip file itself. Try just giving the folder path.

 

VJR_0-1632114502107.png






-------------------------------------------
Help fellow beings find relevant posts.
Upvote to a supporting response.
Mark as solution to an answer.

View solution in original post

VitorBart
Regular Visitor

Thanks for the tip but actually both second and first parameter already refer to folder names, the dynamic pink box string is there because each folder created on each day must be named according to the date when the file was placed on Sharepoint. 

eric-cheng
Solution Sage
Solution Sage

Hi @VitorBart ,

 

Tried the below and it appears to be working as expected.

 

ericcheng_0-1632132063951.png

 

Can you also ensure you are passing the actual filename in the following parameter?  Your action before is creating the file as the 'Name' parameter.  Do you have it after your formatDateTime()?  

 

If so, can you share it?

 

ericcheng_1-1632132146340.png

 

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

 

View solution in original post

VJR
Memorable Member
Memorable Member

Hi @VitorBart 

 

Are you referring that the first and the second parameter already have the same folder names?

 

They will need to be different - one is the zip file and the other is the folder where the files will be unzipped.

 

If the dynamic pink box is the folder name (2nd parameter) then what is in the file name (1st parameter?

Is there a .zip concatenated to it? 

 

Do print both in a compose and check if they are coming out correctly.

 






-------------------------------------------
Help fellow beings find relevant posts.
Upvote to a supporting response.
Mark as solution to an answer.

Hey @eric-cheng, thanks for the tip. Answering to your question I did not have the 'Name' parameter after my formatDateTime(), so if I got it right, I am supposed to make it look like the above picture.

 

The yellow parts are the ones I added after reading your reply, hope I got it right: 

 

VitorBart_0-1632192246483.png

VitorBart
Regular Visitor


@VJR wrote:

Hi @VitorBart 

 

Are you referring that the first and the second parameter already have the same folder names?

 

I thought that both first (1) and second (2) fields were meant to indicate the FOLDERS where (1) the zip file is located and the folder (2) on which I want to have the zip extracted to. I have just modified the first field in order to include the complete path of the zip file including the zip file's name as suggested by @eric-cheng 

 

They will need to be different - one is the zip file and the other is the folder where the files will be unzipped.

 

I see, I hadn't realized that, the field description is kinda poorly named, uh? It only mentions the path name, not the full path including the file name too.

 

VitorBart_2-1632193511369.png

 

If the dynamic pink box is the folder name (2nd parameter) then what is in the file name (1st parameter?

Is there a .zip concatenated to it? 

 

The 1st parameter was pointing to the path where the zip file was located but now I've added the "Name" that comes from the Sharepoint step after the pink box as shown above.

 

Do print both in a compose and check if they are coming out correctly.

I'm sorry, what does that mean? 😞

 

Thanks a lot for your help!

-------------------------------------------
Help fellow beings find relevant posts.
Upvote to a supporting response.
Mark as solution to an answer.


 

VJR
Memorable Member
Memorable Member

Hi @VitorBart 

 

Do print both in a compose and check if they are coming out correctly.

 

By the above line I meant that 

- Take a Compose action and use the Inputs same as the one you added in the "Source Archive File Path" parameter

VJR_0-1632195963328.png

 

- After running it will show the complete text that was passed in the parameters

 

VJR_1-1632196065266.png

 

- Do the same for the other parameter ie; "Destination Folder Path"

 

- By doing this you will come to know whether you are passing the correct parameters/path or not.

 

- Also make sure that you are not passing any of the characters that are not allowed for a file name.

This happens accidentally when we try to format the date with an invalid character like dd/MM/yy hh:mm:ss

In the above example, forward slash / and colon : are invalid file or folder naming characters.

 

VJR_2-1632196191750.png

 






-------------------------------------------
Help fellow beings find relevant posts.
Upvote to a supporting response.
Mark as solution to an answer.

VitorBart
Regular Visitor

I got it !!

 

My mistake was not correctly pointing to the file as mentioned by @eric-cheng !!! I was only pointing to the folder.

 

@VJR thanks a lot for the compose hint, i didn't know it existed, lol.

 

I had to add one condition, tough. Some files were not zip archives so I kept getting error messages.

 

This is the final result:

 

VitorBart_0-1632614983090.png

 

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (3,243)