cancel
Showing results for 
Search instead for 
Did you mean: 

Using Metadata Values Triggers for Actions via Flow

Ever hear feedback from your users that they wish there were easier ways to manipulate documents in Office 365 for their business processes? This is a common use of Office 365 that many organizations have also utilizing via SharePoint server for many years.

 

Beyond using record management features in SharePoint, utilizing metadata to trigger moves, deletions and other actions against documents use to require a fair deal of time in SharePoint designer or using a third party tool from companies like Nintex, K2 or AvePoint.

 

With Flow, this is now a relatively simple process, that takes only a few minutes to set up for any given list or library in Office 365- and don't forget you can copy and re-use your Office 365 Flows to apply to multiple locations!

 

Before I start throwing in some screenshots and line by lines, here are a few tips to remember:

 

  1. You absolutely can combine this information with the features of the SharePoint Records Management System in Office 365 to manage your workflows and documents.
  2. If you have E3 and E5 licenses or an Azure AD Premium license (essentially if you have access to the main suite of features in the Security and Compliance Center) you should also look into the retention policies you can apply via the Office 365 Data Governance set. There may also be additional features for the governance and lifecycle management of your data that third party vendors like AvePoint can provide.
  3. Always remember to plan any implementation accordingly, and understand the security and strategic implications of any solution that you apply to your environment ( will moving certain documents cause the wrong people to have access, violate GDPR standards, cause loss of critical data etc).
  4.  Plan and document as much as you can before implementation. We usually utilize a combination of One Note, Excel, Visio and SharePoint sites/lists to make a record and design pattern of the use cases to fully communicate what it is we're trying to accomplish and how we're going to do that.
  5.  One last thing to note: Everything that I'm going to discuss below can be applicable to Microsoft Teams- The documents for Teams and Microsoft Teams Chat conversations are stored in two places-
    • A folder with the Team Cannel name in the Group "One Drive" or "Documents" document library under the SharePoint Team Site supporting the Team (if you provisioned a Team without a Group, this still exists in Office 365).
    • In the One Drive For Business of the user that has shared the file via a Teams "Chat" with one or more users.

 

Ok great!

 

So let's dive into it!

 

Start by opening flow.

 

Select the "Create from blank" Option, and select the "When a file is created or modified (properties only)" option.

 Image 001.png

Choose the site Address, SharePoint Library Name and Folder where you'd like to enable users to manipulate documents via metadata triggers.

 Image 002.png

 

For the "Documents" Library under a SharePoint site, you'll want to select the "Shared Documents" folder under the "Documents" Library. If this is a Team, within the Shared Folder you should see folders that correspond with the channel names within the Team (See ex. Below).

 

 Image 004.png

 Image 003.png

 

Once you choose the appropriate folder, then choose "Add a Condition."

As the Dynamic Content appears, choose the Dynamic Content that corresponds to the forma of "Column Name Value"

For the example of the library below, the dynamic content is "Action Value" as the column name we will be using for this example is "Action"

 

 Image 005.pngImage 006.png

 

Within the "Action" Column, I've added the Value Type Choices corresponding to the actions I'd like to take. For your organization, the actions that the column values will trigger should be ones that are very clear and easy for your business users to understand. You may even want to include reference documentation and  a policy for how to use them to add a layer of accountability to the process.

 

 

OK, so here's where things get a little tricky.

 

Once you've added the condition, add the "If Yes" action. You'll want the action to correspond with the option you've added to the Condition. Here, I'm saying if the Value is Delete, then delete the file with corresponding File Identifier. (This could enable users with low access levels to delete files if desired, using the access level of the account that authenticated the Flow).

 

Image 009.png 

In the next step, in the "If No" area, I've added another condition. If the previous condition is not met (if the "Value" for Archive is NOT DELETE) then I select the next Value, here "Move To Archive" and then add the next action. Because there is no "Move" action in SharePoint, I'm going to Copy then Delete the source file in question. You'll need to be certain to use the Dynamic Content from the proper action (here from the first step, "When a file is created or modified (properties only)"

 

You'll also want to be sure to use the dynamic content that the corresponding filed requests- the "*File Identifier" gets the Identifier dynamic content from the file in question.

 

 Image 010.png

 Image 008.png

 

 

Continue to add sub conditions for each desired in the "If No" condition area for each step until you've build all the conditions into the flow. When you're done, you can simply leave the last "If No" area blank.

 

 Image 011.pngImage 012.png

 

Success! It worked perfectly! When I selected the "Delete" Option, the file was almost immediately deleted! This surprised even me!! …Great!

 

There you go, now go try for yourself, and don't forget you can do so much more than just move and delete content- using the connectors in Office 365 I've used this function to publish content to external sites on other platforms, move files into BLOB storage, Sync locations- and trigger any other kinds of workflows you'd like using all the power of Flow at your disposal!

Comments

I am not a fan of this resolution. Using this set-up, your flow will trigger everytime anything happens in the specified document library. This is an incredibly wasteful use of a resources when someone only wants the flow to trigger for a specific condition.

 

Given that only 2000 flows per month are included with an Office 365 license, the system you have proposed will eat through those flows within the first week if it is used as an SOP for a small company.

Perhaps that is how Microsoft chooses to make it's money though... By programming small inefficiencies that require users to purchase their premium teirs?

CW

I'm confused. If you're creating a file, there wont be any action items selected yet, so iterating through the choices won't do squat. Where in the flow are you prompted to choose an action item or input any other metadata field?

 

Don't tell me, it can't right? It can send an email though, coooool. Man Frustrated

 

In other words Flow can look around and return things even (yes ladies and gentlemen, even send emails) but any user interaction, well that's for real tools, 3rd party tools like Macroview which was doing that >10 years ago.

Meet Our Blog Authors
  • Working daily with Microsoft Cloud to deliver the needs of my company, my customers and various Microsoft communities and forums. | Office 365 | Flow | PowerShell | PowerApps | SharePoint |
  • Co-founder of https://plumsail.com, Office 365 and SharePoint expert. Passionate about design and development of easy to use, convenient and flexible products.
  • Microsoft Business Apps MVP. Owner of ThriveFast, an Office 365 consulting company.
  • 7x Microsoft Business Solutions MVP (CRM)
  • I'm keen in MS technologies, SharePoint, Office 365 and development for them
  • Daniel is a Business Productivity Consultant & Microsoft Business Solutions MVP who is very enthusiastic about all things Office 365, Microsoft Flow, PowerApps, Azure & SharePoint (Online). Since the preview, Daniel has been working with Microsoft Flow and later on with Microsoft PowerApps. That led to him being awarded an MVP Award for Business Solutions. He loves to blog, present and evangelize about improving productivity in the modern workspace with these amazing tools!
  • Michelle is an Office 365 solution architect in Twin Cities, MN. She has been delivering business collaboration solutions for years with her focus on SharePoint and Office 365. Michelle is a recent board member of the Minnesota Office 365 User Group and has been a member of the SharePoint community since 2009. She is a frequent speaker at MNSPUG and SharePoint Saturday and co-chaired the Legal SharePoint User Group for 4 years. Her most frequent projects have involved rolling out a large deployment of Office 365, SharePoint Online intranet, build of a "CHAMPS" Office 365 user adoption program and most recently, SharePoint On-Premise to Online Migration. Michelle is very excited about cloud technology as it is shifting her IT Pro focus to collaboration strategy and technical adoption.
  • I'm a Microsoft Office Servers and Services MVP with a special interest in SharePoint, Office 365, Microsoft Flow, Microsoft Teams and PowerApps. I work at Triad Group Plc ( https://triad.co.uk)
  • Passionate #Programmer #SharePoint #SPFx #Office365 #MSFlow | C-sharpCorner MVP | SharePoint StackOverflow, Github, PnP contributor