Using Microsoft Flow to create Zip of all the documents available in SharePoint site.
Hello Guys,
In our previous blog we have seen how we can check which users are having SharePoint Document read permission once you share Record with another CRM user and with team. Today we will see how we create Zip of the documents available in SharePoint site.
Before we start, if you are new to our blog then do follow us to know more about Dynamics and Power Platform. Also if you like our blog then please comment and share this blog with your friends.
In our previous blogs of SharePoint we have seen how documents are uploaded to SharePoint site through CRM.
As you can see in above contact record four documents are uploaded. Same we can check at SharePoint site too as shown below.
Now we will be creating a flow which will compress these all files and will be creating a zip file which will be stored as same location.
Navigate to https://us.flow.microsoft.com and select your environment.
Click on create and select Instant Flow and configure it as below and click on create.
Now click on Add new step, search Get Files from SharePoint and configure it as below.
Here we have passed hard coded folder for record. You can retrieve the folder name for which record you want to read documents and pass it dynamically.
Add new step and initialize a new Array variable as below.
Add new step and select apply to each and configure it as below.
Now inside the apply each step, click on add an action. Search Get File Content and configure it as below.
Now we will be appending all the files into an Array. Add new step and select Append to an Array and configure it as below.
Now click on Add new step. Search Add to Zip. You will get this step in Encodian.
Note:- To use Encodian you should be having Encodian subscriptions. You can subscribe it from here. It is third party tool. You can subscribe trail for learning purpose. Once you get trail subscription, you will be getting API key in your mail. use this key as shown below.
Once you click on create you will be seeing Add to archive(ZIP) step. Configure it as below.
Now add a new step. Search Create File from SharePoint and configure it as below.
So now our flow is ready. Click on Test for running this flow.
As you can see in above image it ran successfully. Now we will be checking SharePoint site.
As you can Docs.zip has been created. You can download this zip and extract it. It contains all the documents.
Hope it helps...
Comments
Post a Comment