Microsoft Flow integration in One Drive for Business and new connector actions
Earlier this year, we gave a sneak peak of how Flow would be coming to OneDrive for Business. This week, we’re pleased to announce this feature has rolled out to all OneDrive for Business customers in the world. This new integration allows you to:
- Run a flow on demand for a selected file – You can select any file and convert it to PDF, send it to your manager for approval, ask for feedback over email, or post to Teams.
- Run flows on a folder – You can now set up flows like save your email attachments to a selected folder or get alerts whenever a new file is uploaded directly from OneDrive for Business.
We’ve also recently added several new actions to boost your document management capabilities. These include:
- Convert file using path and Convert file (enabling you to convert files to PDF)
- Create share link and Create share link by path
- Copy file and Copy file using path
- Upload a file from a URL
- Search for files in a folder
- Move or rename files
In this blog post, we’ll walk you through the new integration and some of the new connector capabilities.
Run a flow on demand for a selected file
Let’s suppose you’re working on a series of legal contracts and you want to quickly convert these contracts from .docx to PDF and share with your business partner once they’re ready. You can quickly set up a Flow to do both tasks for you instantly.
In OneDrive, click on the Flow menu, followed by the Create a flow command.
This will open a pane on the right hand side of the window listing several templates you can choose from. Select the template titled Convert selected file to PDF.
Selecting the template will open a new tab in the Microsoft Flow site with additional details about the template. Click Continue.
By default this Flow will convert the selected file to PDF and upload it to the current folder in OneDrive.
Let’s expand the Convert file using path action to get a better understanding of how it works. This action takes in the file path of the file that is to be converted, in this case the selected file, and converts it to the target type of PDF.
Let’s edit this flow and add a Create share link by path action at the bottom of the flow. Let’s set the File Path to be the Path of the converted file (using the Path token from Create file action), the Link type to be Edit, and the Link scope to be Organization.
Now, let’s add an O365 Outlook Send an email action. After setting the To and Subject, we’ll include a link to the converted file in the Body of the email.
Let’s complete our Flow by changing the Flow name to “Convert selected file to PDF and email Dan” clicking the Save flow button.
Back in OneDrive, select a document and click on the Flow menu. Then, click on the newly created flow to run it.
When we refresh the page, we’ll see a newly converted PDF and Dan will receive an email with a link to this file.
Run flows on a folder
From within any folder in OneDrive, you can select the Flow button and the Create a flow command to set up a flow that saves email attachments in Office 365 Outlook to this folder or sends you a push notification whenever a new file is added to this folder.
For example, let’s suppose that we want to save all email attachments sent by a client (Fabrikam Inc.) in the current folder (Fabrikam Contracts). Let’s suppose this client includes the word “Fabrikam” in the subject of each email. We can set up a Flow to automatically save email attachments from Fabrikam Inc. to the Fabrikam Contracts folder.
In OneDrive, while in the Fabrikam Contracts folder, click on the Flow menu, followed by the Create a flow command. Now click on the template titled Save Office 365 email attachments to OneDrive for Business.
This will open the template in the Flow website, confirm your credentials and click Continue. Expand the On new email action and click on the Show advanced options command. Set the Subject Filter field to Fabrikam.
That’s it! Whenever you receive a new email where the subject contains Fabrikam, any email attachments will be automatically uploaded to the Fabrikam Contracts folder. If you have ideas for templates or other feedback, please leave us comments below or post on our Community forums.