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 :
Customer experience | Sales, Customer Insights,...
Suggested answer

How to connect Dynamics 365 records to an existing Sharepoint site/folder (that is already in use)?

(4) ShareShare
ReportReport
Posted on by 28
Hi,
 
I'm trying to connect Dynamics 365 (for Sales) to an existing Sharepoint site/folder. Normally when connecting Dynamics to Sharepoint, I make a new Sharepoint site specifically for Dynamics, but in this case, the customer is already using Sharepoint. So I did the usual steps to add the Sharepoint site to Dynamics, which works fine. However, how can I then connect a Dynamics account to the correct Sharepoint folder? When clicking on the Files tab, it just creates a new folder as if it's a blank/new Sharepoint site. I'd like to connect existing Dynamics records to existing Sharepoint folders.
 
Thank you!
Categories:
I have the same question (0)
  • Suggested answer
    Tom_Gioielli Profile Picture
    2,222 Super User 2025 Season 2 on at
    How to connect Dynamics 365 records to an existing Sharepoint site/folder (that is already in use)?
    If you go to your new document location and open the Account record, but then go to Related > Document Locations does the record appear for you? This is different than the Control that shows on the regular form, so I'm wondering it it appears in your other menu.
     
    You may want to do the following:
    • Turn off the automatic folder creation rule to prevent the duplicate folder from being created automatically
    • Check the control configuration on your form for the documents, make sure things are set properly
    • Try making the SharePoint Document Locations in a relative URL structure instead of absolute (I don't think this is the issue, but maybe worth a shot).
     
    I don't think you are really missing anything. The SharePoint integration is really well built for one specific scenario, and changing how that works is always a little wonky. As an alternative to your requirement, you can also always simply create a new string field with URL formatting and open SharePoint folders in a separate window.
  • Stieben Profile Picture
    28 on at
    How to connect Dynamics 365 records to an existing Sharepoint site/folder (that is already in use)?
     
    Thank you for your reply and the information.
     
    When I walk through the steps and create a new Document Location, I am immediately presented with the following error message:

     
    I have checked the Sharepoint site and it is actually valid and active:

     
    I am however able to fill in the Document Location and set the Regarding to a new account (on which I had not yet opened the Files tab):

     
    When I then do a hard refresh, open the account and open the Files tab: it's empty. In Sharepoint I can then see that it has just created a new blank folder with regards to this account as if nothing has changed.
     
    Am I doing something wrong here?
     
    Thanks!
  • Suggested answer
    Daivat Vartak (v-9davar) Profile Picture
    7,833 Super User 2025 Season 2 on at
    How to connect Dynamics 365 records to an existing Sharepoint site/folder (that is already in use)?
    Hello Stieben,
     

    You've correctly added the existing SharePoint site to Dynamics 365, which is the first step. The default behavior of the "Files" tab creating a new folder is by design when SharePoint integration is enabled. It's geared towards automatically managing document storage within SharePoint for Dynamics records.

    Unfortunately, there isn't a direct, out-of-the-box button or feature within the Dynamics 365 Sales interface to simply "link" an existing Dynamics 365 record (like an Account) to a specific, pre-existing folder within your already in-use SharePoint site.

     

    However, you can achieve this connection through a few workarounds and configuration steps:

    1. Manual Linking via URL (User-Driven, Less Integrated):

    This is the simplest approach but requires users to manually navigate and might not be as seamlessly integrated.

    • Get the SharePoint Folder URL: Navigate to the specific SharePoint folder you want to connect to for a particular Dynamics 365 record. Copy the URL of that folder from your browser's address bar.

    • Add a Link in Dynamics 365:

      • Open the Dynamics 365 Account record.

      • You can add this link in a few ways:

        • Notes: Add a new note to the record and paste the SharePoint folder URL into the note. Users can click this link to access the folder.

        • Custom Attribute (Text Field): Create a new custom text field on the Account entity (e.g., "SharePoint Folder Link"). Populate this field with the SharePoint folder URL for each relevant Account record. You could then potentially create a view or a quick view form to easily access these links.

        • iFrame (Less Recommended for Direct Linking): You could embed the SharePoint folder within an iFrame on the Account form. However, this can sometimes have display and performance issues and isn't a direct "linking" mechanism. 
         

    • Limitations: This method is manual, requires user effort to set up for each record, and doesn't provide the integrated "Files" tab experience.

       


    •  

    2. Using Power Automate (More Automated, Requires Configuration):

    You can create a Power Automate flow to automate the process of creating a link between a Dynamics 365 record and a specific SharePoint folder based on certain criteria (e.g., Account Name).

    • Trigger: Set the trigger for your flow. This could be:

      • When a record is created: To link to a folder created with the same name upon Account creation.

      • When a record is updated: To link based on a specific field update.

      • A scheduled flow: To process existing records in bulk. 

    • Action: Find or Create Folder in SharePoint:

      • Use the "List folder" action in the SharePoint connector to check if a folder with a specific name (e.g., matching the Account Name) already exists in your desired SharePoint library.

      • Use a "Condition" to check if the folder exists.

      • If the folder doesn't exist, use the "Create folder" action.

      •  

    • Action: Update Dynamics 365 Record:

      • Add an action to update your Dynamics 365 Account record.

      • Create a custom text field (as mentioned in option 1) to store the URL of the corresponding SharePoint folder.

      • Populate this field with the URL of the found or created SharePoint folder. 

    • Limitations: This still relies on a custom field to store the link and doesn't directly integrate with the "Files" tab. It also requires a logical way to identify or create the corresponding SharePoint folder (e.g., naming convention).

    •  

    3. Custom Code (Plugin or Web API - Most Integrated but Complex):

    This is the most technically involved option but can provide a more integrated experience.

    • Develop a Plugin or Use the Web API: You would need to write custom code that executes when a Dynamics 365 record is created or updated. This code would:

      • Connect to SharePoint using the SharePoint API.

      • Based on the Dynamics 365 record (e.g., Account Name), identify or create the corresponding folder in your existing SharePoint site.

      • Potentially update a custom field on the Dynamics 365 record with the SharePoint folder URL.

      • Crucially, to integrate with the "Files" tab, you would need to understand and potentially manipulate the underlying data structures that Dynamics 365 uses to manage the SharePoint document locations. This is not a well-documented or straightforward process and could be subject to change with platform updates.

      •  

    • Consider a Custom PCF Control: You could potentially build a Power Apps Component Framework (PCF) control to embed on the Dynamics 365 form. This control could allow users to browse the existing SharePoint site and manually link to a folder for the current record.

    • Limitations: This requires significant development effort and a deep understanding of both the Dynamics 365 and SharePoint APIs. Integrating directly with the "Files" tab's default behavior for existing folders is complex and not officially supported.

       


    •  

    Key Considerations and Recommendations:

    • Naming Convention: Establish a clear and consistent naming convention for your SharePoint folders that makes it easy to identify the folder corresponding to a Dynamics 365 record (e.g., using the Account Name or Account Number). This will be crucial for any automated or semi-automated linking approach.

    • Information Architecture: Carefully plan your SharePoint site structure to ensure it's organized and manageable as you connect Dynamics 365 records.

    • User Training: If you opt for a manual linking approach, provide clear instructions to users on how to find and add the SharePoint folder links.

    • Start Simple: Begin with the manual linking approach (option 1) to understand the user needs and the scale of the linking required. Then, explore automation with Power Automate if the manual process becomes too cumbersome.

    • Avoid Direct Manipulation of Dynamics' SharePoint Structures (if possible): Directly trying to modify the underlying way Dynamics 365 manages SharePoint locations can be risky and might break with future updates. Focus on linking via URLs or building custom UI elements.

    •  

    In summary, while a direct "connect to existing folder" button doesn't exist in the Dynamics 365 interface, you can achieve this by manually adding links or by building automation with Power Automate to store SharePoint folder URLs on your Dynamics 365 records. For a more integrated experience with the "Files" tab, custom code or PCF controls would be necessary, but these are significantly more complex to implement and maintain.

     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.
     
    My response was crafted with AI assistance and tailored to provide detailed and actionable guidance for your Microsoft Dynamics 365 query.
     
    Regards,
    Daivat Vartak
  • Suggested answer
    Tom_Gioielli Profile Picture
    2,222 Super User 2025 Season 2 on at
    How to connect Dynamics 365 records to an existing Sharepoint site/folder (that is already in use)?
    There are tables in the backend that control the SharePoint integration. If one of these records does not already exist, then the system will create a new one. This means you will need to backfill or handle the creation of these records before the user opens the File tab.
     
     
    You can build up these records with absolute or relative URLS, and then you relate them to the Account record. They are relatively simple, so you should be able to do this through an import if you already have your folders created. If you want to have this continue to happen dynamically, you will need to use something like Power Automate to handle creating folders and the Document Location records when a new Account is added.
     
    If this answer helped, please consider marking as verified.
  • André Arnaud de Calavon Profile Picture
    298,959 Super User 2025 Season 2 on at
    How to connect Dynamics 365 records to an existing Sharepoint site/folder (that is already in use)?
    Moved the question from the Dynamics 365 General to the Dynamics 365 Sales forum.

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 > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 258

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 179

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 129 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans