{"id":110871,"date":"2017-08-25T06:30:59","date_gmt":"2017-08-25T13:30:59","guid":{"rendered":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/support-for-sharepoint-document-library-properties\/"},"modified":"2017-08-25T06:30:59","modified_gmt":"2017-08-25T13:30:59","slug":"support-for-sharepoint-document-library-properties","status":"publish","type":"power-automate","link":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/support-for-sharepoint-document-library-properties\/","title":{"rendered":"Support for SharePoint Document Library Properties"},"content":{"rendered":"
In a blog post<\/u><\/a> earlier this month, we announced read-write support for Person, Choice, and Lookup fields. This week, we\u2019re pleased to announce another highly requested feature<\/u><\/a> in the SharePoint connector \u2013 support for document library properties<\/strong>.<\/p>\n This support comes in the form of two new triggers – When a file is created (properties only) and When a file is created or modified (properties only) and three new actions \u2013 Get file properties, Get files (properties only) and Update file properties.<\/p>\n In this blog post, we\u2019ll walk you through a detailed example of how to use these triggers and actions. We\u2019ll also use this opportunity to introduce you to a couple of additional properties that have been added to ease your flow building experience.<\/p>\n Let\u2019s suppose you have a document library for housing legal documents. In this library, you\u2019ve added a Person column to track a document\u2019s owner. <\/p>\n Let\u2019s create a flow that will:<\/p>\n Notify the Chief Legal Officer and assign him\/her as the owner whenever a new document is added.<\/p>\n<\/li>\n Notify the owner whenever a document is modified<\/p>\n<\/li>\n<\/ul>\n To do so, create a flow from blank and add the trigger \u2013 When a file is created or modified (properties only).<\/strong> Notice how this trigger contains a Library Name<\/strong> field which enumerates all the document libraries in your site.<\/p>\n Now add a Condition<\/strong> where you check whether the [Modified]<\/strong> property is equal to the [Created] <\/strong>property. If it is, then this is a new document. If it\u2019s not, then it\u2019s a modified document.<\/p>\n In the If yes<\/strong> branch (new document), add a Send email <\/strong>action. When you select the To field in the Dynamic content dialog, you\u2019ll see all the fields in your document library including the Owner field which is further broken down into properties such as Owner DisplayName, Owner Email, Owner JobTitle, etc. Set the To<\/strong> field to the Chief Legal Officer, the Subject<\/strong> to \u201cNew document added – [Name]<\/strong>,\u201d and the Email Body<\/strong> to \u201c[Link to Item].\u201d <\/strong>Name and Link to Item are additional properties we\u2019ve made available (more on this further down in the post).<\/p>\n After the Send email action, add the Update file properties<\/strong> action. This allows you to update the properties of a file. If you want to update the contents, use the Update file action. Match the Site Address and Library Name with the values entered in the trigger. Set the Id field to the [ID] of the uploaded file. For the Owner Claims field, select from the list of users or enter a custom value.<\/p>\n In the No branch (modified document), send an email to the Owner letting them know that a file they own has been modified and include a link to the item. In this case, we\u2019re using the Owner Email field which is a property of the document library and the Name and Link to item properties.<\/p>\n In this release, we\u2019ve appended some new properties to triggers and actions to make SharePoint items easier to use in Flow and PowerApps. These properties are not direct visible in SharePoint. The full list is below:<\/p>\n Name \u2013 file name of the item in document libraries, display name of the item in lists<\/p>\n<\/li>\n Folder path \u2013 Path to the folder the item is in, relative to the site address<\/p>\n<\/li>\n Identifier \u2013 Value that can be used in file related actions for selecting a file<\/p>\n<\/li>\n Link to item \u2013 Link that can be used to get to the file or list item. Only people with permissions to the item will be able to open the link.<\/p>\n<\/li>\n<\/ul>\n We are working on adding the item ID as an output of the Create File action, so that you can use it in conjunction with the Update file properties.<\/p>\n The SharePoint + Flow story continues to be a high priority for us and we (can\u2019t stop) won\u2019t stop until we\u2019ve ensured Flow is a worthy successor to SharePoint Designer workflows. As always, share your feedback using the comments below. If you have a question or an idea, head over to the Microsoft Flow Community<\/u><\/a>.<\/p>\n \u00a0<\/p>\n","protected":false},"excerpt":{"rendered":" Flow now gives you the ability to read and set SharePoint document library properties. Check out this post to learn more about how to use these highly requested features. <\/p>\n","protected":false},"author":350,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","power-automate-category":[2752,2836],"power-automate-tag":[2556,2754,2777],"coauthors":[2911],"class_list":["post-110871","power-automate","type-power-automate","status-publish","hentry","power-automate-category-product-updates","power-automate-category-walkthroughs","power-automate-tag-document-libraries","power-automate-tag-properties","power-automate-tag-sharepoint"],"yoast_head":"\n<\/p>\n
<\/p>\n
File Triggers and Actions<\/h1>\n
<\/p>\n
\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
Additional Properties<\/h1>\n
\n
Known issue<\/h1>\n
Onwards we go<\/h1>\n