Bulk Creating SharePoint Folders

How to Bulk Create SharePoint Folders in Dynamics 365

Instead of manually creating a SharePoint folder for every Microsoft Dynamics CRM record, you can also create them automatically in bulk.

Tip! PowerAttachment can save space inside Dynamics 365 by storing attachments inside your SharePoint integration.  Start a free 30-day trial now.

To begin bulk creating SharePoint folders for the account entity, follow these steps:

  1. Once you have your SharePoint site configured in CRM, the first step is to create a map drive to your SharePoint site. There are many different ways to map a drive, but the easiest option is to right click on My Computer and select Map Network Drive. Select the drive letter and enter in the path to your SharePoint site. https://sharepoint.crm.sharepoint.com.
    Bulk Creating SharePoint Folders
  2. Get your list of Accounts that you want to create the folders for. Within CRM, go to the Account entity and open the Advanced Find function. From here you can pull up the active Account view and modify the columns only to include Account name.
    Bulk Creating SharePoint Folders
    bulk creation img 3
  3. Run that query and export the list to Excel. Save the file to your local computer.
    bulk creation img 4
  4. Open the Excel document you just created. To this document, add two new columns.
    First, create a new column where all it has is a quote. Copy this to each cell.
    Then create the following formula:   =CONCATENATE(B2,A2,B2). Now copy the formula to each cell that has an account value in it. Your excel sheet will look like this:
    bulk creation img 5
  5. Open Notepad and add the drive letter that you used in step one. Use the CD command (Change Directory) on the entity that you are creating all the folders for (Account in this case). Once that is done, copy and paste the new column that you created in Excel into notepad. Save the file with the .bat extension. Your file should look similar to the one below.
    bulk creation img 6
  6. Run the .bat file. This may take a while depending on the number of folders you are creating.
  7. Once the folders are created, update CRM with the URL to the specific folder. This can be done by creating an on demand workflow. To do this, first create a workflow with the following attributes:
    on demand workflow process
    user owned (to prevent someone else from accidentally running the workflow).
    bulk creation img 7
  8. Now add a Create step to create the document location. Select the Relative URL from the lookup. Select the Account name for the relative URL. Select the account for the regarding field.
    bulk creation img 8
  9. Run this workflow for each Account. Click the workflow button from the ribbon and select the workflow you just created in the step above. Once the workflow has completed, you can now go to the documents section in the left navigation to see SharePoint and CRM linked together.
    bulk creation img 9
    bulk creation img 10
    bulk creation img 11

With this simple process, you can eliminate the daunting task of manually creating a SharePoint folder for every CRM record.

How to Save Money on Licensing for Office 365 and Dynamics 365

Most companies can save money on Dynamics 365 and/or Office 365 licenses when enrolling in PowerObjects’ no-cost CSP program.  Learn how much you could be saving here.