web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Disable "Document Management" / Auto-Creation of Folders in SharePoint

(4) ShareShare
ReportReport
Posted on by 34
Hi everyone,

I've enabled Document Management for one of our custom tables. Now, whenever a new record is created in our Model-Driven Power App and a user opens the Documents tab under Related, Dynamics automatically creates a folder in SharePoint for that record.

We also have a Power Automate Flow that creates a custom-named folder (with a specific folder structure and additional content) when a record is created. As a result, some records ends up with two folders in SharePoint:
 
  • One automatically created by Dynamics (due to Document Management being enabled)
  • One created by our Flow (which is the correct, intended structure)
This duplication is causing confusion, and I'd like to disable the auto-creation of the SharePoint folder by Document Management - but I haven’t been able to find a way to do this.

I’ve looked through Advanced Settings and also considered whether there might be a system table like Document Location where this could be managed, but so far, no luck.
 
Has anyone run into this before? Is there a supported way to prevent Document Management from creating folders automatically - while still keeping the Documents tab visible, or at least without breaking other functionality?
Any guidance, workarounds, or pointers would be greatly appreciated. Thanks in advance!
Categories:
I have the same question (0)
  • Adis Profile Picture
    5,724 Super User 2025 Season 2 on at
    Disable "Document Management" / Auto-Creation of Folders in SharePoint
    Hi,
     
    Could you share where you have enabled Document Management, in which app?  I am a bit confused tbh, maybe its just me though...
     
    As far as I understood you want to leave Document management enabled, but disable the the automatic creation of the folder in sharepoint, is that correct?
     

    Kind regards, Adis

     

    If this helped, please mark it as "Verified" for others facing the same issue

    Keep in mind that it is possible to mark more than one answer as verified

     
     
     
     
  • Caspar_Rubin Profile Picture
    34 on at
    Disable "Document Management" / Auto-Creation of Folders in SharePoint
    Hey @Adis, thanks for asking.
     
    I'm fairly new to Dynamics/Dataverse/Power Platform...
     
    We've got a custom model-driven app where from where i opened the Advanced Settings in the top right Settings icon.
     
     
    Under "Document Management" I've enabled it for "Accounts", "Contacts" and our custom "Contracts" table. It created 3 Document Libraries in SharePoint.
     
    For Accounts and Contacts it's fine as it is, automatically creating folders in SharePoint when we need them with the name it selects itself but for our custom "Contracts" Table I would like it to stop automatically creating folders if a user navigates to the Documents Tab in the Power AppApp.
     
    For example, in our SharePoint Document Library for our Contracts, we now have something like this:
     
    Our Power Automate Flow creates a Folder with sub-folders etc. for every contract and relates it to the record, when a new record is created in that table.
    But that takes a minute or two and if people click very quickly on "Related/Documents" in the Power App, the system creates the folder because it has no related folder yet. Is there a way to disable that?
     
    For example, this is what it looks like in the power app, sometimes, when users are not patient, they navigate to the documents tab right after creating the record in the contracts table and before the flow finished and they then they have multiple document locations (2 Folders, one from power automate and one from the document management internal system):
     
    I hope you can follow me... I really want to find a solution for this, please let me know if you need any more information that would help you help me... =) thanks!
  • Verified answer
    Tom_Gioielli Profile Picture
    2,319 Super User 2025 Season 2 on at
    Disable "Document Management" / Auto-Creation of Folders in SharePoint
    You could try something like the following:
     
    • Update your form so that the 'Documents' tab is hidden by default
    • Add a custom field called [SharePoint Created] that is a boolean
    • After your Power Automate flow creates the SharePoint folders and the Document Location record, set this new field to TRUE
    • Add JavaScript to your form that will show the Documents tab when this field is TRUE
     
    This way, you can still use the OOB Document tab functionality while preventing users from seeing it (and thus navigating to it and creating a document location early).
  • Verified answer
    Caspar_Rubin Profile Picture
    34 on at
    Disable "Document Management" / Auto-Creation of Folders in SharePoint
    Thank you @Tom_Gioielli for taking the time, i appreciate it!

    I followed your suggestion and added a new boolean column to the table. When the flow creates the folder, it sets this column to true. Then, a small JavaScript script shows or hides the "Documents" tab (under "Related") based on that value. Works perfectly!
     
    Here's the script for anyone having the same issue:
     
    function toggleDocumentsNavVisibility(executionContext) {
        var formContext = executionContext.getFormContext();
        var showDocs = formContext.getAttribute("BooleanFieldLogicalName").getValue(); // replace with your field
        var navItem = formContext.ui.navigation.items.get("navSPDocuments"); // this is the standard name for "Documents"
        if (navItem) {
            navItem.setVisible(!!showDocs); // show if true, hide if false
        }
    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Sahan Hasitha Profile Picture

Sahan Hasitha 109

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 77 Super User 2025 Season 2

#3
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 70

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans