Microsoft Team for each Key Account using Conditional Rules in DocDrive365

   Words by Paul McQuillan

   on 20/01/2021 06:00:00

The standard use of DocDrive is to configure the set of rules for how Documents should be stored for Records of that Entity or Table in Power Apps or Dynamics.

But what if we need to have branching logic for different types of record within the same Entity?

Commonly this crops up when we look at Companies we work with, and some of these can be Key Accounts or Customers that we may want to track a more detailed set of documents over a non-key account.

This often appears when we want a new Microsoft Team for a Key Account or Customer, and a Folder in a standard Document Library for a Supplier or other Company Account.

This guide will show how this can be configured.

Find our Entity

To start with we open the Entity Definition for our intended Table in the DocDrive365 Model App, in our example we will look at the Account Entity.

This will usually have a number of rules looking like the following:

image

This will typically include a pair of Bucket and Record Rules defining a Document Library as the ‘bucket’ to place each new Folder for an Account Record.

These rules will currently be non-conditional and so running for all Accounts - so our first time is to make these two conditional.

image

Conditional Rules

We can open both our Rules and look at the list of Conditions for each Rule.

For a Non-Conditional Rule, this will be blank.

In Power Apps this is a Many-to-Many relationship between the Rule and the Condition - so we can attach an existing Condition we have already defined, or create a new Condition for our logic.

We can start from scratch by creating a new Condition to only carry out this Rule if the [Relation Type] field is not ‘Customer’.

image

With this condition created, we can attach to both the Bucket and Record Rules:

image

This then means that only Non Customer Accounts will be valid for these Rules to store documents via the basic Document Library and Folder combo.

Microsoft Team per Account

Now we can look at defining our alternate flow if the Account is a Customer.  We do this by defining a 2nd Record Rule that defines that DocDrive should create a new Team for each Account as per the following:

image

We then make this Conditional to define which Accounts should be represented by a Team in Microsoft Teams - in my case, a Condition that allow does this is [Relationship Type] is ‘Customer’:

image

image

With this combination of Conditional Record and Bucket Rules our Entity Definition will look like:

image

Testing for a Non-Customer

We can then create new Account Records to test how this works for our Customers and Non-Customers.

Starting with Non-Customers, we can track a new Account and review the Location created for us in SharePoint.

image

image

Testing for a Customer

Whereas if we create a new Account and flag the Relationship Type as Customer, this will create differently into SharePoint or in this instance, MS Teams.

image

We can see the result in Microsoft Teams:

image

Or by clicking Location to browse into SharePoint directly:

image

Non Customer to Customer?

On key element is that often an Account or other Record will upgrade or qualify to a Key Account in Dynamics, and so go from meeting the original set of Conditions to a different Condition.

If or when this happens, the logic in DocDrive will pick up on the change and adjust the Document Location automatically.

So if test it an initially non-key account:

image

This is reflected as a Folder in SharePoint.

But on changing the Relationship Type, this promotes into a new Team:

image

If need be, we can then demote back into a non-key account and go back to the Folder – this does not however automatically delete the Team (or any previous Location), just reversing the location that the Record in Dynamics is associated with.

This swapping of locations as the Account changes which Conditions are met (and so which Record and Bucket Rules are applicable) – does not automatically copy or move Documents between the Locations, this remains a manual process but can be automated using Flow via the DocDrive Connector.

Correctly configured, for each New MS Team created will come with pre-installed with the DocDrive Teams App.

This App allows for Posts and Updates to be posted from Dynamics into Teams – either as simple Messages or detailed Adaptive Cards.

The App also enables the DocDrive Bot in the Teams to allow commands to be raised from Teams to find or raise new information in Dynamics.

Get in touch and see a demo of DocDrive in action

  • Your Name *
  • Your Email *
  • Tell us a bit about what you are looking for?
 
* Required before sending

Our Clients