Monitoring SharePoint file update using Power Automate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] it's almost a year that I am publishing courses on udemy and since then I noticed there is a big change in my youtube channel most of the videos that I publish are answers to the questions from my students or support of my courses that I published there sometimes I missed something there in the course and I packaged it in a YouTube video and I communicated that missing element to my students and most of the time when they ask me questions if I think it's worth sharing with the other people I create a video and put it on YouTube so everybody will enjoy and get benefit out of it today video is one of those videos again there's a question recording file updates on SharePoint so if something is changing if a file property is changing if you want to track it and we want to fire a flow and there are different ways to do that I have a chapter in that course but when I look back into that chapter in the Microsoft flow crash course I think this is a valid point I really didn't dig into that concept as much as I wanted to and anyway that was a beginner course so I was not really expecting this level of questions from my students regardless we are getting deep into it so if you want to see different ways that we can monitor file updates inside Microsoft power automate or flow let's see how it works if we check the lists of the triggers that they actually monitor SharePoint lists or libraries people find three triggers one of them is when the item is created or modified which is related to items not document libraries the other one is when a file is created or modified which is specifically looking into libraries and when the file is created or modified in a folder so basically there are three different triggers that they can monitor and they will fire when item is updated or rated inside the SharePoint library although the first one says item is created and it clearly refers to a list item knowing that SharePoint library is also a kind of list we can actually use this one to to monitor a library all these three works perfectly fine I start from the third one when the file is created or modified in a folder let's see what it has and how it performs inside SharePoint I created a library called lip 0-1 I also added a column called category so when I upload a file actually I can also set the category for it for example training business marketing or whatever you want and it's plain text I already created two dummy files test zero one and test zero two I just drag and drop them into this folder and I also signed a category for it so if I select this one I can click on edit and I will set that category to marketing and click Save and you're the one I select it and I set the category to training and I click Save so now we want to use every single one of those triggers and monitor these items in this library and see how they work I go back to flow that Microsoft comm I click on create and I want to create an instant flow I click on skip I create everything from scratch and I use SharePoint and when I click on SharePoint I would say Maadi when the file is created or modified in a folder so I select this one I go to the SharePoint site that I have if you have the URL in the list so basically yeah if you have already used it you can pick that up just like me otherwise click on enter custom value and then you can just copy and paste the URL of this site here paste and when I enter the URL I can click on this folder and I can pick the list or library that I want to use which is lip 0-1 if you want to monitor a subfolder you can take it a little bit further and if there is anything you can use it at the moment there is just built-in forms folder which I don't want to work with it at the moment I'm happy with lip 0-1 so I created a trigger that is watching a library and let me just change the name and I give it a name as SP library watch and I really don't want to do anything after that I just want to add a new step and put the output of this trigger inside this compose so compose I click on compose I just get the entire output I can of course I can get the file content file type and all those things and keep in mind that that this trigger returns actually the file content so basically whatever that is inside the file which is perfect at the moment I really don't want to get into the details but here is the thing there are no properties here let me just go to the expressions and get the trigger output here turner output is an expression which basically gets the output of this trigger once it is fired and brings it here and compose shows us the entire thing that this guy returns in a JSON their variable so I just click on OK and then I click on safe let's go back to SharePoint and make some changes I go to the file that I have here for example test zero one I click on it SharePoint opens it the content I changed something and it's automatically saved I just go back to the library and we go back to flow and see if it is fired actually so let me go back to the parent it is actually fired and if I click on it inside Campos I should see whatever that Disgaea returns and as you can see it has some header but mainly the body contains the content type and the content so basically the binary content of this file is inside this variable we're good with that so let's get back to our PowerPoint slide when I use when the file is created or modified in a folder I can get the file content but what if I go to SharePoint and change the metadata instead of training for this one let me select this one edit all and instead of training let me call it business and I click Save does it fire the flow let's get back and see I go back to floor on history again I click on this library refresh refresh we wait for five minutes and see if anything happens and yes finally when I refreshed it it actually fired and it gives me the same information which is fantastic so basically when I'm using the when the file is created or modified in a folder regardless if I change the file content or the file metadata or the other properties it still fires although it only gives me the file content not the property if you really want to get the properties you need to get item or get file from this library and work with it from that moment onwards so we learned about when the file is created or modified in a folder the other one is when the file is created or modified properties only now let's try this trigger and see what we get out of it so again I go to edit view I delete this one okay now again I look for SharePoint SharePoint and I look for modified let me close this okay when a file is created or modified properties only so we pick up this one again I look up the URL the library name is going to be lip 0-1 and the folder is optional if I don't pick the folder it looks the entire library but if I pick the folder it only looks inside that folder so again I go to lab 0 1 which is the root folder I can pick folder but at the moment there is no folder inside it so we're good with what we cut again I come here inside compose I go to expression and again I would say trigger outputs and I click OK and I click Save apart from that when I click here you will see this one now has a lot more it has category that that is the field that I added myself and lots of other built-in field so basically when you are using the when the file is created or modified properties only it returns us all the file properties in this list and of course if I've added any properties myself which is the category here so if I click Save and test it this time I go to this SharePoint and I change something which is business I change it - for example finance I click save and let's see if the trigger is fired so I go back to and let's see the last call so when the last call is happening if I click on this if I go to Campos this time you'll see a much longer list so it has headers hey and if I scroll down on their body it's not just content and content type you have the ID you have item internal ID you have modified editor blah blah blah it also has editor claims category created author and a lot more information so basically everything that you need from the file other than the content this trigger does not give you the content but it gives you the filename and extension that you can actually use it to get the file using the other actions if that's what you need to work with great so this one also fires if you change the file content or the file property although it only returns you the property so you got to make up your mind if you want to work with the file content you gotta use when the file is created or modified in a folder this one gives you the file content while this one gives you the properties let's do the last one which is when an item is created or modified this one is a little bit tricky but I love to use this one and here is why I like it I take it to flow designer again I go on edit and let's delete this item and add my favorite one SharePoint I click on SharePoint and again I look for Marty white and this time I'm looking for when an item is created or modified this trigger specifically targeting lists so when I pick the site and if I go to the list name you do not see this library lib 0 1 close it it's not there are great but what if I say enter custom value and manually type Lib 0 1 and I save it of course compose is empty so I click on expression and I click on trigger output right click OK save and before I go to SharePoint I want to show you something when I click here it shows me category checkout so basically although it does not look it up as soon as you enter the right listening it reads all the properties it has a fine limit extension for path identifier is folder blah blah blah and all those properties basically it has everything everything except for the content apparently let's save it and see if it works so I go back to the library again let me fire this trigger by changing this marketing too and I change the marketing to business I click on save and let's go back to flow oh I can't forgot sake SP library let's refresh it a few times and see if we get it yep and we got it so this is the last execution if I expand it and if I click on compose it will give me Heather's body contains the data tag ID modified editor and all the other fields let me scroll down category which is the field that I just updated created author and it goes on and on everything except for content which is fantastic if you want to get anything other than file content you can use this one if you need the file content after this trigger is fired you got it use the ID and look it up using another action and I think you can take it from there and work with the return values of these triggers and thank you for watching I hope you enjoyed this video and you learned something new I always appreciate your comments don't forget to Like and subscribe and also check my course catalogue on udemy the link is in the video description [Music]
Info
Channel: Alireza Aliabadi
Views: 5,719
Rating: undefined out of 5
Keywords: SharePoint, Document library, Flow, Power Automate, Trigger, File update, Document update
Id: -zgcMLlX6_4
Channel Id: undefined
Length: 17min 3sec (1023 seconds)
Published: Sun Apr 26 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.