Learn how to Auto Create Document Folders for Each SharePoint List Item using Power Automate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
do you ever get frustrated using the attachments option with SharePoint lists this isn't as easy to use as document libraries where you can grab a whole set of files and drag them in and it's easy to create folders and subfolders and things like that well it's very common in SharePoint lists where you want to do something like track a project and actually there's going to be documents associated with the project so rather than use the attachments function with SharePoint list there's a nice solution where you can simply create a folder in a document library and have that connected with your SharePoint list so that's what we're going to look at in today's video a really easy convenient way for you to automatically create and Link a folder in your SharePoint list so that you can easily manage documents tied to that SharePoint list record and with that let's get SharePoint smart [Music] foreign vanilla SharePoint team site I just created the site I have one list in it which is called projects and I haven't done anything else to it now what I'm going to show you could go ahead and do this to an existing list you can add whichever Fields you want but I've just focused in on the basics of what we need to do to accomplish the functionality today so in order to set this up we're going to need to have a column to store a link to this folder that we're going to automatically create in the documents Library which is automatically created when you set up a new SharePoint team site so I just need to add a single column I can just click on the header and I need a hyperlink column so I can go through here and select type of your link you can do this from the list setting screen as well so that's what I want hyperlink and I'm going to call this documents I'll click on the more options it does not need to be required and add to content types that's fine so I'm just going to hit save okay there's my column what we're going to be doing is setting up a simple workflow which is going to automatically create a folder in the documents library and then add the link here to the documents column so as I mentioned every SharePoint team site by default has a documents library and the URL it's referred to as shared documents that's what I'm going to use for this demonstration of course if you want to you could create another library and use that instead either one will work just fine so here's what we want to happen we're going to want to have this folder automatically created every time a new record gets added to this SharePoint list and then we also need to update the list item with a link to that folder so let's go ahead and get into Power automate so we can accomplish those steps so I'm going to switch over to power automate and I'm going to do a new flow so I'm going to do automated cloudflow and let's give it a name when a new project is created make folder okay and there it is it suggested to me when an item is created that's our trigger so I'm going to click create and then we'll be brought out into the power automate canvas where I can build my flow okay at this point I need to select the site address where this is here's my site which I just created and then I'm interested in the event when a new item is added in the projects list that is our trigger I don't need to do anything with any advanced settings for this so the first thing when this is created I need to create a folder and so luckily there is a flow block just for that purpose I can just type create folder and there it is it suggested as the first item create new folder and once again it's going to ask me for the site address and there it is and then I want to make the folder in the default documents Library as I mentioned you could use another Library if you wish and then it's asking me for the folder path you can have of course nested folders and things like that in our case we just want to make a folder in the root directory so this is going to be very simple so I'm going to call the folder project and then I'm just going to use the ID I'm interested in the id id because I know that it can't get changed and that's important to me because naturally in a SharePoint list the titles of projects and other fields tend to get updated and changed and I don't want anything that could get broken later the ID will stay set and it's guaranteed to be guaranteed to be unique so that's what I want to use so I'm just going to use the IDE value right after project and that will be the name of the folder okay so that's going to create our folder now we want to automatically populate that documents hyperlink column with a link to this folder that we just created so in order to do that I need to do a update item workflow and I'll just click on update item and for a third time we're going to go ahead and select the site again so there it is and then I just select the SharePoint list projects and then it's asking which item to update well I just pass along the ID of the item that was created so be careful here because you've got two IDs make sure you pick the one under when an item is created okay and then the next thing that I want to do I'm just going to Simply pass along the title of what was in there when the item was created normally the title field by default is set required I turn that off but um you can leave that required just make sure you pass along what was already in title okay and that is the hyperlink field now special thing to know about this currently there is not a simple way to set the value to hyperlink field in flow and what I mean by that there are two pieces of information for hyperlink column one is the actual URL which of course we're interested in the other is the label the plain text that makes it readable and it doesn't give us a way to set those two values in here now there is an advanced process you can go through which is difficult in order to go through that it's generally not worth their time and in fact we don't especially need that we're going to actually do something a little bit different as you'll see in a couple minutes as I get further along in this process so for the sake of what we're doing we're just interested in the URL itself so what I'm going to do is come back over to my SharePoint site and what I want in particular is the path to that shared documents Library so what I want to do is just copy and paste that and just paste that right in and then recall that we use the word project in the beginning of the folder name now you can use whatever name you want in my case I was dealing with a list which is projects you could come up with whatever name the key thing is that you make this step match with the preceding step where you created the new folder and then recall that we are using the ID again be careful here make sure that you pick the right ID we need to use the ID from the item that was created don't make the mistake of picking the ID of the folder then you it's not going to work all right so I've got that set and I can save that believe it or not should pretty much be everything that we need to do in our flow we're actually ready to test this and we can see this in at work okay so let's go ahead and create a new item in our list um whoops I'm in the wrong area I need to go to my projects list and I'll do new I'll say apples project and Save okay now we do have to wait for that flow to respond sometimes that can take a little bit sometimes it's quick that can vary might be immediate might be sometime within a minute so we're just gonna wait we can monitor our flow in here and we will eventually get our flow trigger this is just part of using power automate it's kind of like waiting to catch the bus so to speak but we can keep refreshing here and once that flow has executed we're going to see that result listed down here and then we can go back to our SharePoint list and do a refresh and we'll check our results while we're waiting for that I'm going to mention the next part just so you know what's coming we're going to be applying a formatting template a Json formatting template to make a nice looking link so it's more user friendly and to do that we're going to be using a free template that's available over at the SharePoint dashboards.com site and that is the button hyperlink template so we're coming to that if you do not have a sign up for that you can get a free sign up it's really easy to do just go in there to the gallery screen and you can click on the free sign up at the top of the page for that all right let's see if power automate has caught up yet not just yet sometimes it can take a little bit of time for these to run normally it would take quite this long but um it can vary I think especially when you create a new flow sometimes that adds a little bit of time as well I'm going to do another record while I'm waiting for that one I'm gonna pause while I'm waiting for this to finish okay flowers being a little bit finicky with me it was being slow to respond but it is working and we'll go ahead and check our results so if we go to the documents Library you're going to see these folders that we're creating you can see they have generic name so if I was browsing this it might not mean a lot to me but that's not going to matter because our users are going to get to these libraries from here now here's the link so first of all let's double check and make sure this works okay so if I click on that link it does open to the folder which is what we intend but we have a problem that's not user friendly at all we don't want to show this long URL we want something that looks nice and now we're going to go ahead and apply a template in order to get that result so as I mentioned you can go to the SharePoint dashboard site and get a free account and that includes 20 free templates one of those templates is called button hyperlink that's the one that you want to use it's pretty easy you just log into the tool you can pick whatever kind of Icon you want on your button this is just to open a folder um I'm just gonna pick one quick for the sake of time obviously there are loads of options here so I'll just pick this one and then that's really all that I need to do over here then you click on copy template and then just follow the instructions and the pop-up click OK and now I can pop over to SharePoint and let's make this documents column look much nicer so go to column settings format this column advanced mode and then just paste in the template and we're looking better although I still don't want to see this long URL lucky for you that is a very easy fix if you look over in the code window it's trying to pull in the description if you remember in the flow there's a limitation where it wasn't going to allow us to put a friendly label into that and that's okay we're not not going to use that we're just going to type documents explicitly so it's in this text content field that's at the very bottom at line 44 you can just replace that conditional statement that's in there with that text and now things are going to look much more user friendly okay so it still does the same thing if I click on this it's going to pop open that window for me and now I'm free from the list item attachments functionality now I can drag and drop files in here in a batch I can make subfolders whatever I want and this is all going to be automatic at this point so let's go ahead and do one more project just to prove this is all working the way we want it so we got figs project I'll save and then this will trigger the workflow so we just have to give it a little bit of time to percolate since we have power automate open I can just refresh it on this page and you know that way I'll know when it's run normally this is going to be pretty quick um and the thing that's nice about this is it's going to happen automatically every time a record gets generated in that list so the user doesn't have to do anything no extra steps in order to take advantage of the functionality okay there's the latest run and that means when I refresh the page over here I'm going to see the update so in the documents Library there's my new folder in the projects list here's my column and if I click on this it goes specifically to that folder and it looks like we are all set okay I hope you guys found that useful if you're like me if you use SharePoint for a long time you probably will agree that the attachments functionality and SharePoint lists it's not that user friendly it certainly doesn't allow us the ability to do subfolders or batch select items and drag and drop them into the interface that type of thing it's really not a great setup but we use SharePoint lists all the time for tracking projects tracking approvals and keeping up with all kinds of different processes within the organization and it just makes sense that you want to have the ability to manage files using the part of SharePoint that already works really well which is the library's functionality so this lets you marry those two things together and get the both The Best of Both Worlds so to speak so I hope you found that useful um hopefully you can follow through those steps and you can set up the same functionality in your SharePoint site and the more you do it it's going to be you know easier and easier and your users will thank you for being able to have this functionality thank you very much [Music]
Info
Channel: SharePoint Smart
Views: 14,605
Rating: undefined out of 5
Keywords: SharePoint, Power Automate, Power Apps, Microsoft 365
Id: CtWS9gZH2sI
Channel Id: undefined
Length: 19min 8sec (1148 seconds)
Published: Thu Dec 15 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.