How To: Automatically Create Document Location for Records in Dataverse

Use this simple Flow as a template to create the document location for a record in Dynamics 365 or your custom Dataverse application.

Use Case:

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 their is, Dynamics/Dataverse is not. There is one problem with the way this works out of the box and that is the location for the documents does not exist until the user requests to view the documents in the Dynamics/Dataverse user interface. This causes problems for users who want to view that folder in SharePoint or sync the SharePoint library to their file explorer with OneDrive sync before a user has 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 you documents. i.e. 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 have 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

Important to note here, 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 5 step Flow is pretty powerful and can certainly streamline your workflow for the scenarios I mentioned above, plus can be extended to be more advanced including subfolders and separate document locations.

Author: Bernie Thibeault

What I love most about Dynamics 365 is how it streamlines processes for businesses of all sizes. Every organization is unique, but they all have the same need to get more done in less time. Dynamics 365 is the solution to do that. I'm a skilled listener who knows how to get beneath the surface and hone in on exactly what clients need to get out of Dynamics 365, making him one of the most valuable additions to any team.