Send Documents To SharePoint with Power Automate Desktop & Creating SHARING LINKS with Ease!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey what's up everyone new video different hat so today we're gonna play a bit with the Creator sharing link action in the SharePoint connector in power automate desktop so our scenario is going to be we're going to upload a document in SharePoint online so we're going to see what are the steps required for this then we're going to create our sharing link and finally we are going to send this link via Outlook and we're going to see two different ways to do it with accessing nested properties and also if we use HTML or not in our email body so let's do it foreign [Music] okay so let's get started and something we're going to do first which is completely optional but that can help seeing the process that we need to go through so I'm gonna look for comment and I'm gonna put my steps in here the first step would be to upload a document to SharePoint then we need to create a sharing link and finally we need to send the link via email and I'm going to put Outlook client because that's really important and click on Save now the first thing we need to do when we try to upload a document into SharePoint is we need to convert that file we cannot just grab the file and upload it into SharePoint but before we actually do this we are trying to be as dynamic as possible so we are going to set a variable that would contain our document and I'm going to call that variable file to upload and I'm going to go and grab my file now I'm going to paste the path and once you paste the path you need to remove the double quote otherwise it's not going to work now like I said we need to convert so let's look for convert and we should have covert file to Binary data which is just there so let's drag it onto the canvas and we're going to look for our file paths click on the X for the variables file to upload click on select and the variable output would be binary data now we need to upload our file to SharePoint so let's have a look at the SharePoint actions so SharePoint at the bottom and then you might think that we may have something that looks like upload where we actually don't and if we look for create we have create file and if you hover over it we can see it says uploads are fine so that's the one we need I'm gonna grab it and now we need a few parameters so we have the site address the folder path file name and file content so let me open SharePoint and I'm going to grab the site and by the way you can see that here in documents where we're going to upload our document I have nothing and emails I have nothing either okay so I've grabbed the path I'm just going to paste it in here and then we have folder path now folder path might be a little bit confusing because this is not folder as we know it a folder and SharePoint can also be a library and so that's exactly what it wants in here and we said we're going to upload that into the documents Library which the internal name basically would be shared document so I can just type it if you want or what I can do is just click on the select final folder and because I have my site path in here it knows the libraries that I have and here I have my shared documents which is what I typed before then we have the file name so this is basically not the path but just the the file name itself that was um my file name again do not put any quotes double quotes or single quotes this is not necessary and then we have the file content the file content would be in our variable binary data select it and then we click on Save and now we're on to the next step which is create a sharing link so we have this new action under the SharePoint preview and if I just drag it in here it's going to ask me again for some similar parameters and also if that's the first time that you're actually using the SharePoint actions you will need to create a connection reference and as you can see here I already have my connection reference that is created if you haven't done that before it will ask you that's a one-off task and it will not ask you again now for the parameters that we have in here again we have the site address so we know that the library name we know that as well and then it's asking us for the item id which at this stage we actually don't know because the file is now uploaded and we're going to scroll down we have the link type the link type is going to be some permission so View and edit or view only and then we have the link scope which is going to be people in your organization or anyone with the link so before we actually start doing this um we are missing the item ID so let's cancel that and at this point we're going to run the flow and see if the item ID is in any of those variables so click on run and now if we look at the flow variable and their output we can see straight away that we have the missing piece in here so the file response in here would give us the item ID great so let's click on close let's grab the create sharing link again and now we should have all the information we need to fill those parameters but before we do that let's just delete this so as you can see the file was uploaded properly delete and then go back to Power automate desktop so the site address again the library name this is documents the item id let's keep that for the end then we have the link type we are going to choose just view only it doesn't really matter people in your organization and then under Advanced we can also decide of a link expiration and a timeout so where is this item id we've seen this is the output one of the output of this variable so let's grab the create file response variable and underneath we have the item id let's click on this one and click on select in case you don't know how to access properties from the output of a variable you can have it this way so you can see it's the variable name Dot and then the property name so we can have it like that and there's also another way to do it which would be you remove the dot square brackets and then single quotes and close the square bracket so that would work as well now we have everything filled properly and the variable output would be create sharing link response click on Save and at this point we should be good to go to create our email so we're going to start by opening Outlook this is going to create an Outlook instance and then we're going to send our email so send email through Outlook client the Outlook instance is the one we've just created the account would be the account sending the email and so the message will be coming from this account now enter the recipient we're not going to use the CC and BCC and for the subject we can put new file sent via power to meet this up and then for the body as you can see below there we can format our email with HTML so actually we're going to see both results because if you format with HTML it's going to make your email a little bit prettier let's write something short and then we need to grab the link so where is actually that link let me save that for a second and show you exactly what we are after so when we create the sharing Link in here we're going to have a response and that response will have some properties so what we can do at this point because we're not sure we can just run the flow and once we get the output of this variable then we can construct our email a little bit better so let's run that now and we're gonna go into the site just refresh the page our file has been uploaded let's go into the email and that's great news we have the email and obviously we have nothing in here because we didn't put the link to the file but what we are interested in is the output of the create sharing link response so those are the properties and the values that we have you can see that we have an ID we have a link in here and also we have the more that we can click on so if we click in here we have even more properties that we are interested in and this one the web URL is actually the one we're interested in remember that it's going to be under that variable then the link property and then the web URL would be again a nested property so let's go back double click on our email and this time we're going to insert our link click on the X for the variable we're going to have our create share linking link response then we have the link and then we have the web URL select it and this should be the link itself so let's just finish that off thanks and is the body HTML not yet we're going to see that response first and we don't have any attachment so let's click on Save and I've already deleted the email and the document so we can run that safely now so let's have a look so our file has been uploaded and for the email this is what we have please see below for the link to the file and we have our long URL and if we click on it then it's opening the documents great so if that's enough for you and the link is okay that's fine everything is working but what we're going to do now is we are going to format the body of the email with HTML so we can display something different that this long URL so let's delete that and let's go back to the email and what I'm going to do here I'm just going to delete that and I'm going to paste what I had already basically we just use HTML tags in here so the paragraph the brake line and then this is how we're going to construct our URL so we have the exact same thing as before this is the formula for the link and again like I showed you earlier this is a different syntax which is basically grabbing the variable and then the nested properties so if you want to access a nested property that's the way you would write it so the first property and then the nested property between square brackets and single quotes and the href with the anchor would be for making that text a link and the other variable that we are using in here is to display the name of the file so the name of the file is contained within the create file response variable and again we have this property which is called display name so because we are using HTML we need to toggle this on to make sure that power to my desktop knows that yes my body in here contains HTML damn it let's click on Save and again let's run the flow and let's check it out refresh document was uploaded email and this is what we get and this time you can see that the link is the name of the document and again if we click on it we have the same document so I hope this video was useful to you and I will see you next time
Info
Channel: Veronique Lengelle | MVP
Views: 3,508
Rating: undefined out of 5
Keywords: SharePoint, Power Automate, Power Automate Desktop, Automation, microsoft power automate, power automate tutorial, robotic process automation, power automate desktop tutorial, power platform, rpa, microsoft power platform
Id: AB-mmkYqDSI
Channel Id: undefined
Length: 15min 38sec (938 seconds)
Published: Wed Mar 29 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.