Use this simple Flow as a template to create the document location for a record in Dynamics 365 or your custom Dataverse application.
Almost everyone using Dynamics or Dataverse leverages the SharePoint integration to store their documents. This is great, because SharePoint is the best document management tool available, and Dynamics/Dataverse is not. There is one problem with the way this works out of the box: the location for the documents does not exist until the user requests to view the documents in the Dynamics/Dataverse user interface. Users cannot view that folder in SharePoint or sync the SharePoint library to their file explorer with OneDrive sync before they have requested the document location in Dynamics/Dataverse because it doesn't exist yet!
This Flow is really simple and will streamline this process for your users. You can even expand on it to include creating custom nested folder locations for your documents, such as an Account folder that has a subfolder for each Contact record.
In my example, I was building this Flow for a client's new product development process, where they wanted their SKU table to automatically generate a folder for each SKU so that users could work in SharePoint or their custom Dataverse Model App to upload the SKU documentation.
Step 1: When a record is created
Step 2: Create a New Folder
Step 3: Get the Parent Document Location
This step is important. You need the parent document location so that the document location you create in Dataverse follows the same path as the folder that was created in SharePoint. In my example scenario, the document integration for Dataverse automatically creates a document location record for the SKU table. That will serve as our parent, and I grabbed the GUID from that record to put in my action here.
Step 4: Create the document location
It's important to note here that the relative URL must match the folder name from the SharePoint folder that was created earlier.
Step 5: Relate records
This step sets the regarding field of the Document Location record in order for it to show up in the subgrid of the SKU record.
This five-step Flow is pretty powerful and can certainly streamline your workflow for the scenarios I mentioned above, plus, it can be extended for more advanced iterations, including subfolders and separate document locations.