DocDrive365 Day Three: Opportunities and Bucket Folders

   Words by Paul McQuillan

   on 15/11/2019 10:00:00

We have seen how DocDrive can create new Document Libraries and Folders for records in Dynamics, and how related records can form the structure for how our documents are stored.

We can also look at the concept of ‘bucket’ folders that can build not just a Folder for a Record, but also other ways of dividing record’s into a logical set of document locations.

So we could potentially divide how we store the Documents for Opportunities by the Type of Opportunity,  or by the Month or Year when the Opportunity was created – this helps keep our Document Structures manageable and governable, and avoid the problem of having a big long list of Folders that can make navigation more difficult.





Lookup Rule

Link up to the Parent Account


Link up to the Parent Account


Bucket Rule

Group Folder by Opportunity Type

New Business

Group Folder by Year


Record Rule

Folder per Opportunity

Equipment Supply

Folder per Ticket Number


Before we look at how this is done for Opportunities in the initial DocDrive Configuration, we can actually see this concept in the definition of the earlier Account Entity.


Here we can see the top DS3 Rule defining a ‘bucket’ location to use before the DS4 Rule then creates a Folder per Account.

Drilling down into this rule gives us a basic definition to use or create a Document Library in SharePoint as the bucket, and that this Document Library should be created with a simple fixed title of ‘Client Documents’.


Looking at Opportunities, we can also see this bucket rule concept in evidence with each Opportunity we open.

Picking an Opportunity and clicking LOCATION in the DocDrive Panel or the Dynamics Documents List will show us the following way we have defined for Opportunities to be managed:


We can see that the Opportunity’s Document Location is being built via:

1. DS2 - Parent Rule looking up to the Folder for the Company Account

2. DS3 - Bucket Rule defining that all Opportunity Folders should be tracked in a fixed folder for ‘Opportunities’

3. DS4 - Record Rule adding a new Folder for each Opportunity

This structuring is available in the DocDrive Entity definition for Opportunity – as we can see our respective three rules in the definition:


This is a similar ‘fixed’ bucket to put our Opportunity Record Folders in.

However we can change this to start using a non-fixed Bucket Folder that would instead depend on a Field in the Opportunity record itself – so say we wanted to model the scenario where our Opportunities were sub-divided by the Currency involved in the Opportunity, then we would amend our Bucket Rule to create a Folder based on the ‘transactioncurrencyid’ field of the Opportunity.

To do this, we would change the [Map Type] from ‘Fixed Mapping’ to ‘Field Mapping’, and set the [CRM Field] to the Database Name of the Field we want to use.

We can also reset the [Template / Fixed Value] to use the CRM Field we want to bring in – so we can set this to ‘{0} Sales’ as way of using the value of the Currency Field and then following with Sales so the resulting Folder is clear.

The [Data Type] we can leave as String in this incidence, as this will simply ask DocDrive to interpret the Lookup Text of the Currency Field using its Text/String definition:


NOTE: This type of mapping and choosing whether to use the Value or Text of the Field can be done for Option Sets, Lookups, Dates or any other type of Field we track within Dynamics.

With this in place in the DocDrive Configuration – we can see this in action.

If we create a New Opportunity and set the currency to ‘US Dollar’, we will see this reflected in SharePoint as {Account Name} >> US Dollar Sales >> {New Opportunity Name}


This gives us a way of sub-dividing groups of Opportunities within the structure of the Parent Customer Account – if this is useful to us.

This concept of a Dividing Folders or Document Libraries by a Bucket can be put to use in a variety of scenarios to help ensure we get the structure of Document Management right between our Records in Dynamics and SharePoint.

Do Changes to the DocDrive Configuration take effect immediately?

Yes – DocDrive does a range of caching behind the scenes, but refreshes this cache when a change is recorded to the DocDrive Entity or Rule records.

What happens to existing Records and SharePoint Folders?

Nothing happens for already existing records – any rule changes in DocDrive update the logic for new records being added to Dynamics, but do not change existing records.

This is to keep the consistency of existing Links and SharePoint Locations even when the Rules change; and corresponds to how Dynamics stores the Document Locations to associate Records in Dynamics to SharePoint Locations.

This gives an initial view of Bucket Rules to work in tandem with Record Rules, we will see this again when looking at the Case Entity in the initial configuration from the DocDrive Wizard and how this uses the Date of the Case as a Bucket Rule.

This configuration allows to configure what happens up the chain in terms of the Lookup to Rule and now this Bucket Rule, but we can also look at down the chain in terms of having Sub-Folders from our record.

But before we do, it may be useful to reference a quick guide for how records in Dynamics can be renamed or deleted to update the Location in SharePoint.

Share this Article

Search Articles

Filter Articles

CRM Tech DocMan

Recent Articles

HOW TO: Virtual Entities in Dynamics 365 Release Wave 2 New Feature: The Columns Button HOW TO: Search a date field in Microsoft Dynamics The Relevance Search COMING SOON to Power Apps Portals HOW TO: Manage Your Dynamics 365 Database Size (Video Included) Dynamics 365 Marketing vs ClickDimensions It’s time to pause, reflect and acknowledge a new era of inclusivity and collaboration. Part 2 - How to get the most from a Technology Expert – Asset Management Hub Property & Asset Management Hub Part 1 – Balancing CRM and Asset Management Scopes - Asset Management Hub Creating a Multi-Lingual PowerApps Portal How to Set Up a Microsoft Teams Site Using DocDrive365 Microsoft Teams - Adding a Microsoft Teams URL to a Dynamics Appointment Dynamics 365 Marketing – Customer Voice Survey Not Appearing In Emails? Using SQL Management Studio to connect to the Dynamics DB Calling a Power Platform AI Builder Model via oData How to use DocDrive365 to integrate permissions between Business Units in Dynamics with Sites in SharePoint Getting started with the Power Platform AI Builder. Power Apps Portal Information Hub DocDrive365 Security: Day One - Getting Started with Dynamics to SharePoint Permissions Part 5 - Power Apps Portals: How To Connect Azure B2C With Linked-In Part 4 – Power Apps Portals: Styling Azure B2C for Power Apps Portals The 3 Phases for Using Multi-Select Option Sets in Flow with Microsoft Forms Part 3 – PowerApps Portals: Azure B2C and Power Apps Portals – User Flow for Signup and Signin Part 2 - Power Apps Portals: New Application Registration in Azure B2C for our Power Apps Portal
Contact Us

Want expert advice or a demo?

Get in touch now and see how we can help your business grow.

  • Name
  • Email Address
  • Phone Number

Understanding Your Challenges

Our strong understanding of CRM and emerging technologies within the Microsoft environment means we deliver the right solutions for you.

Proven Real-World Solutions

As a leader in the field of Dynamics solutions, our pedigree developing and delivering real-world solutions is unsurpassed.

Long Term Support

We provide support beyond our design, implementation and 'go-live' delivery using Sprints and continual updates to our AppSource apps.

CRMCS | Design by Thinktank Marketing | Citrus-Lime Limited

To improve your experience today and in the future, this site uses cookies. Read our full Privacy Policy & Cookie information here I Understand