Power Automate - Unzip files from Incoming email attachments

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone welcome back to the channel in today's video we are going to take a look at one of the scenario where i'll be receiving emails with zip files and i'll be unzipping and extracting the documents out of that zig file and storing them into sharepoint so for that i am going to use power ultimate so as you can see i have opened power automate home screen and now i will be creating my instant cloud flow and trigger i'll choose when i'll be inside so the trigger i would be using is when email arrives so you can use multiple triggers over here for example email arrives in your shared mailbox if your emails the zip file emails is coming is send is being sent to your shared email boxes or if directly emails are sending to some specific mailbox then you can pick so for testing i'll be speaking when an email arrives in my mailbox and in this trigger i'll be setting that up include attachments because i want that zip file as attachment and i want to trigger this action just if the attachment is there so i'm just setting this up so when when a new email arrives into my mailbox for example this one is having one zip file and i'll be storing this zip file into sharepoint and extract this zip file content to the sharepoint only so i just go back to my flow and in next step i'll be using create file action because i would like to first of all add the zip file whatever zip file i'm receiving as in part of email attachment to sharepoint and later on then i'll extract that zip file so i'm just creating file and specifying my site address and folder path folder is document and filename we can choose the attachment name as soon as i choose that attachment name it ended up that to apply to each because attachments can be multiple but for our example we will be just working with one attachment zip attachment only and file content attachment [Music] so we are picking that up from time it content so now whenever file comes will create one attachment over here so in next step i would like to extract the properties for this file which is created so that's why i am going to use that file property action and again using my site address library name so over here this is the item id the file which we created initially in this apply to each so to have that id directly i would not get it any identifier so if if i try to type over here id so because this create file is binding into this the scope is just applied to which that's why we would not get at any dynamic content so we have to initialize one of the variable at the initial step so i just initialized variable and it's a file item id and i'll just set that up as integer and under apply to each i'll just set this variable just after that create file action so set variable i choose that item id and now i'll choose i'll get in the dynamic content i'll get the item id of my discrete file so we are good and now this item id the file item id variable which we are using we are setting up in previous step we can use that to get the file properties so i can use it now so now till here we created zip file attach we got a zip file attachment we created one file into sharepoint and get the properties of those files so now in next step i have to extract so the zip file content so i'll be directly using extract folder action under sharepoint and i'll again bind that to site address okay so we have this source file path and the destination file path so this source file path we can get from get file properties so if you type in dynamic content as path so two parts we get so one is folder path and another is full path so because this source file paths we can simply choose that full path so it will give me like that slash share documents slash if my attachment is docs then doc dot zips and then destination folder path i need to use the folder path so i again type dynamic content and i use folder path and if i just leave it over here then my extraction would be directly inside my this document library so that would be i mean like if number of files increases that would be quite confusing that which attachment is unzipped from this zip file so i'll just create one subfolder and that subfolder would be by name of that zip file so i just choose name so now this thing the destination part that extracted path will be like it's a subfolder one doc sub folder would be created and all the extracted files will be inside that subfolder all right so we have done the extraction folder as well so now i'll just save this so now for testing i'll just create one new message and send that message to myself and i will attach the file the zip file from my computer and let's say give a test message over here and i'll just send this message with attachment and i'll just wait for trigger okay so my this flow ran successfully it created that file in sharepoint and got the properties and extracted so i'll just go to my shared document library i'll just refresh it so you can see that i initially my the stock start zip got uploaded and later on this uh the content which is inside this zip is extracted to buy this subfolder and if i click on it i got these two files which used to be zipped in this the initial docs zip folder so we are done we have successfully unzipped the content of the file the attachment which we got as part of email so you can do the same thing for unzipping onedrive content you can do the same thing directly if somebody is uploading document zip file into sharepoint library you can use that extract folder actions within the sharepoint to sharepoint so because i got this scenario where one of the shared mailbox used to send the zip files to me to my inbox so for for reading out those files and storing that in sharepoint so manual stuff was required so creating this flow did the entire automatic stuff for me so it's a valid case for me so it could be a valid case for you so that's it for today's video if you like this please do drop your comments and subscribe to my channel thank you
Info
Channel: M365 Tech Help
Views: 18,976
Rating: undefined out of 5
Keywords: Power automate unzip files, Power automate extract files from Zip folder, When an email arrives with attachment in MS flow, Extract files from zip folder using MS flow, Extract incoming email attachment in SharePoint folder, SharePoint library zip and unzip files, Get zip file as attachment and unzip in SharePoint using flow, MS flows to unzip folder, Extract files using Power Automate
Id: RgPIZFQZ9jg
Channel Id: undefined
Length: 8min 44sec (524 seconds)
Published: Fri Mar 11 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.