cancel
Showing results for 
Search instead for 
Did you mean: 
themsenduser

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
About the Author
  • Experienced Consultant with a demonstrated history of working in the information technology and services industry. Skilled in Office 365, Azure, SharePoint Online, PowerShell, Nintex, K2, SharePoint Designer workflow automation, PowerApps, Microsoft Flow, PowerShell, Active Directory, Operating Systems, Networking, and JavaScript. Strong consulting professional with a Bachelor of Engineering (B.E.) focused in Information Technology from Mumbai University.
  • I am a Microsoft Business Applications MVP and a Senior Manager at EY. I am a technology enthusiast and problem solver. I work/speak/blog/Vlog on Microsoft technology, including Office 365, Power Apps, Power Automate, SharePoint, and Teams Etc. I am helping global clients on Power Platform adoption and empowering them with Power Platform possibilities, capabilities, and easiness. I am a leader of the Houston Power Platform User Group and Power Automate community superuser. I love traveling , exploring new places, and meeting people from different cultures.
  • Read more about me and my achievements at: https://ganeshsanapblogs.wordpress.com/about MCT | SharePoint, Microsoft 365 and Power Platform Consultant | Contributor on SharePoint StackExchange, MSFT Techcommunity
  • Encodian Owner / Founder - Ex Microsoft Consulting Services - Architect / Developer - 20 years in SharePoint - PowerPlatform Fan
  • Founder of SKILLFUL SARDINE, a company focused on productivity and the Power Platform. You can find me on LinkedIn: https://linkedin.com/in/manueltgomes and twitter http://twitter.com/manueltgomes. I also write at https://www.manueltgomes.com, so if you want some Power Automate, SharePoint or Power Apps content I'm your guy 🙂
  • I am the Owner/Principal Architect at Don't Pa..Panic Consulting. I've been working in the information technology industry for over 30 years, and have played key roles in several enterprise SharePoint architectural design review, Intranet deployment, application development, and migration projects. I've been a Microsoft Most Valuable Professional (MVP) 15 consecutive years and am also a Microsoft Certified SharePoint Masters (MCSM) since 2013.
  • Big fan of Power Platform technologies and implemented many solutions.
  • Passionate #Programmer #SharePoint #SPFx #M365 #Power Platform| Microsoft MVP | SharePoint StackOverflow, Github, PnP contributor
  • Web site – https://kamdaryash.wordpress.com Youtube channel - https://www.youtube.com/channel/UCM149rFkLNgerSvgDVeYTZQ/