How to improve the integration between Dynamics 365 and SharePoint using Power Automate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys samuel boulanger from power platform geek in today's video we'll look at how we can replace the out of the box integration between dynamics 365 and sharepoint using power ultimate uh into this video i have two goals the first one is to automatically create a folder in sharepoint when i create an account in dynamics 365. if you didn't know the creation of the folder in sharepoint using the out of the box function is not created at the creation of the account itself you need to navigate to the document tab to trigger the integration my second goal is to create subfolder inside sharepoint that will be accessible from dynamics 365 so i want to create a folder hierarchy in the first part of the video i'll go to the uh out of the box integration so how it works because i think it will help to build the power ultimate afterward and in the second part we will build the power ultimate itself so let's take a look okay so before starting creating our flow let's look behind the scene how the integration between sharepoint and crm works from the crm standpoint and from the sharepoint standpoint so the first thing that's important to understand is with the basic integration function when you create a new account okay so for instance our platform test and you save the account nothing happened technically so the integration will only be applied when you click on the document tab what will happen when you click on this document tab there's two things the first one is a folder will be created in sharepoint and in crm um a record will be created in a table called document location that i'll just show you in a bit so right now i created this account and if you navigate to sharepoint and you look on my subfolder account on my my site that is synchronized with with the crm you can see that nothing has happened so there's there's no no folder called power platform geek test that has been created inside sharepoint and if you look in the table called document location you can see that that nothing has happened now if i navigate to the document tab and i go back to my sharepoint site you can see that now the folder has been created and if i navigate into my document location tab it's also been created so the structure of sharepoint need to be replicate kind of inside this document location tab so for for each folder you will need to create um a record in this tab so if i open one just show you you can see that for this document location which is set regarding my power platform geektest account i now have the relative url which is the the name of the folder itself in sharepoint and i have my parent site and in my parent site if i open it you can see that now i have as a relative url i have the account folder again that's the name of the folder inside of sharepoint okay so we really need to replicate the entire path from sharepoint inside this document location table now what i want to overcome as a limitation using a float actually there's two things the first one is i want the folder in sharepoint to be created at the moment where i create the account the second thing is i want to create subfolders okay i have a key of folders that i want to create each time an account is created inside the crm so if i quickly turn on my flow that i already made and that i navigate back into the system to create a new account okay so my float just finished running and if i navigate back there you can see that it's been created right away so i didn't have to navigate to the document tab and i have subfolder 1 and subfolder 2. okay you can add whatever folder you want you can go multiple depth inside the subfolders if you want to it's a little more complex but for this video today we'll just create subfolders in the into the main table which which the the integration is activated so now let's go creating our flow so for this flow our trigger will be from the common data service when a row is added modifier deleted for this example i'll use the account tab so when an account is created i'll put the organization as the scope first thing i want to do is i want to create a new folder in sharepoint so for my action i'll just look for sharepoint create a new folder and we want to create a folder inside our um existing folder called account okay so to replicate kind of the behavior of the out of the box integration so if you click on the site address you will have a list of your different sites if you just created the sites it's happened to me that the site wasn't appearing in this list so what i did is just enter custom value copy paste the address of the site okay so in that case will be this one um maybe you'll get an error message but if you continue to the next step list or library as you can see same if i get this error message i'm able to choose from the different document that i that i have right now in this specific site so let's choose account and then the folder path uh is the name of the folder itself so the name you want to give to the folder that we will create in that case i will give the account name if you want to replicate the behavior of the out of the box integration you want to add a new unique number after your account name it's feasible you can do it using flow or you can create a nota numbering field inside powerapps and then add it after the name of the the the folder path itself okay so now we've created our main folder okay so just the account folder now we will create our subfolder so now we get to sharepoint again create new folder site address again it's an account but now in the path we will add the parent folder okay so it will not recreate it it will just understand that you need to create the new folder inside this parent folder so the parent folder name is the account name so i'll just choose again account name so we'll drop it inside this folder we've just created in the prior step then i'll do that slash and the name of my folder so in that case i'll just put it manually and then let's create a second folder just rename this one before count sub folder one okay now our next action sharepoint create a new folder again we select the site address the list and the folder path with subfolder 2 and just whoops just rename it account subfolder 2. okay so now what we just did when a new account is created the main folder is created inside the document account that reside on my my sharepoint site power platform geek crm and then i create one subfolder inside this main folder and then a second folder inside this main folder now we want to create the records inside the document location table in crm now we will need to get the parent document location inside crm so as i just show you with the evidence fine we have the path in sharepoint replicated inside the document location tab so now you have the parent site there account so all of those have the account tab as a parent site so we will need to get the id of this specific record in order to attach it to our newly documented created uh document location to do so we will need the guide okay that you can find the url there at the top so you have the grid of this document location record which is account okay so just make sure you you select the right one so if you're you're creating a flow for opportunities or quote or any other tables into the system just make sure that your relative url is the right one corresponding to the folder uh or to the patent to sharepoint okay so once you have it you can look after this id equal and that's where you'll find the grid okay so we'll just copy this value and then we'll navigate back uh into our flow and we will get information about this specific record so get a row by id okay so document location whoops and we'll just pass the id we just copied from the crm okay so now we're getting the document parent document location then we will create the subfolder that we will link to this parent document location okay so we will again create a new record so add a new row inside the table called document location well you can give it whatever name you want uh but i suggest that you use the the same one as the folder in sharepoint but that's not really important that's the relative url that must be uh the same thing as in sharepoint so if you look at there at parent site that's where we will build our hierarchy here with the the parent and we will look for the odata id there where we in our step where we get the parent document location info we will just put it there in parent site or location and finally we will put the relative url so that's how uh crm will understand the path of what is built inside of sharepoint so again i'll use account name and our last step let me rename this one our last step will be to link or relate this row so this document location with the record itself so the account which we just created so again i'll take an action the common data service and i'll look for related rows i'll choose account the row id is the account from my my trigger actually okay so um account yep so this one the unique identifier of the account then i will need to select the relationship okay so will show me all the relationship that exists in the system for the account table right now what i'm looking for is the relationship for document location accounts sharepoint document location so i'll select this one and i'll relate it with the row i just created there this one by using the odata id again there you go so now it technically should work if i didn't made any mistakes so let's just test it let's create a new account and structure test save it there we go so if i navigate back there and i go to document subfolders has been created the sharepoint structure itself have already been created so i have access to my different subfolder and if i navigate back there oops account sharepoint structure test2 so that's it well now you're able to improve the native integration between dynamics 265 ensure point and to automatically create a folder structure inside of sharepoint and dynamics 365. thank you guys for watching if you have any questions or suggestions for a future how to or tutorial don't hesitate to leave a comment and if you enjoyed this video and want to be notified of new release don't forget to hit the subscribe button special thanks to external vision who supported me in producing this video if you want to see more power platform content i also encourage you to follow their channel see you in the next video
Info
Channel: Samuel Boulanger
Views: 3,852
Rating: undefined out of 5
Keywords: Dynamics365, Sharepoint, PowerPlatform, PowerAutomate, DynamicsCRM, Automation, MSFlow
Id: raFH4l88PGA
Channel Id: undefined
Length: 15min 53sec (953 seconds)
Published: Fri Apr 02 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.