Create Custom D365 Assistant Cards

I have received several requests to write an article about how we can utilize Power Automate to automatically create custom cards that will be shown in the Dynamics 365 Assistant. If you are not familiar with the Dynamics 365 Assistant let me tell you about it, as I feel it’s a great tool. The assistant used to be called the relationship assistant and is part of Dynamics 365 Sales Insights. It allows users to stay on top of things by displaying cards to sales users. The assistant uses the data in Dynamics 365 Sales and in exchange to create the cards. There are two different levels for the assistant:

Standard: The standard assistant is included with D365 Sales Enterprise. This allows you to utilize the existing card rules and settings but you don’t have the ability to create custom cards.

Premium: The premium assistant gives you all the capabilities you get with the standard edition, but on top of that gives admins the ability to create custom cards. Keep in mind that the premium edition is part of Dynamics 365 Sales Insights, which is an additional cost.

There are two different types of cards: notifications and insights. Examples of card notifications are cards that are shown when a record has been inactive for a while or when an opportunity is nearing it’s close date. The assistant can also warn a user when an email is sitting in their exchange inbox and inform them about upcoming activities like appointments or phone calls, etc these types of cards are insight cards. You can read more about cards here.

Users can configure the assistant by navigating to the ‘Sales Insights’ area in Dynamics 365 Sales. Admins will see ‘Assistant Studio’ on the left side of the screen. In order to configure existing cards (turn them on or off, configure when they should show) admins need to click on ‘Insight Cards’ under ‘Assistant Studio’. A list of available cards will be visible and when a card is clicked the configuration window for that card opens up. This is where you can turn a card on or off. The settings tab allows admins to assign security roles to cards, so that only users with the same security role will be able to view the card. Some cards have additional configuration options like when to show a card. NOTE: An example of this is the ‘No activity with contact’ card, which has the option to select the number of days that should have passed if there hasn’t been any activity before a notification is shown.)
There are some pretty informative cards that you get with the free version, so I if you haven’t checked it out yes, I would recommend you do!

Now that you understand what the D365 Assistant is, lets now talk about how we can use Power Automate to create our own custom cards. If you have the Sales Insights license and navigate to the Sales Insights Settings area > Home (under Assistant Studio), you’ll see the ‘+ Create a new insight card’ option on the top. When you click this button you’ll be taken to a screen where you can choose from many different power automate templates. For this exercise I am not going to use any of the templates because there is none for what I am looking for. NOTE: You can also directly create this logic in Power Automate.

Scenario

When leads are created, they automatically get assigned to a team and then a manager of that team assigns the lead to an individual. I ONLY want the system to show a card when a lead is assigned to a person, I don’t want to show a card if the lead is assigned to a team. This was a bit hard to figure out; yes I could just have the flow trigger on ownership and then put a condition in after the trigger that would check if the owner if a user or a team, but I don’t want the flow to run at all if the owner of the lead is a team. My coworker Chris Driscoll came to the rescue and helped me with this configuration. Thanks Chris!

Solution

Click on the ‘+ Create from blank’ button on the top right. The flow editor window will open. Enter the name by typing over the ‘Untitled’ name on the top (under sight cards). I am going to call this ‘Assign New Lead Card’. Select the “When a record is created, updated or deleted-Common Data Service(current environment)’.

As mentioned above, we want to trigger this flow when a user is assigned to a lead so we need to select ‘update’ as the trigger condition. The entity (table) is ‘Leads’ and I select ‘Organization’ as the scope. Since we only want this to run when a different owner is assigned, I am using the ‘ownerid’ field as the filtering attribute(column), and I am going to run this as the process owner. Now as mentioned before, I only want this to run when the owner of the lead is a user, not when it’s assigned to a team, so I have to add this logic as well. Click on the ellipse (…) of the ‘When a record is created, updated or deleted’ and click ‘settings’. In the trigger conditions field is where we can set this logic:
@equals(triggerOutputs()?[‘body/_ownerid_type’],’systemusers’)
By entering this logic, the flow WILL ONLY TRIGGER if the owner is a systemuser.

Click the ‘Done’ button to save the configuration and then click the ‘New Step’ button. This is where we will create the card in the assistant in Dynamics 365. Search for the ‘Create Card for Assistant V2(Preview) action. This is where we will enter the details of what to show on the card, who to show it to, how long to show it, etc. Below are the items I will be using:

  • Card Name: The message on the card that will be displayed
  • Card Header: What will show on the header of the card, which is under the Card Name. (I am entering the lead topic here)
  • Card Text: The text on the card when the card is expanded, I am entering the dynamics value ‘Name’ and ‘Company’ (from the lead).
  • Primary Action Text: This is the text that will be displaying the action that can be taken (I.E Open Lead)
  • Primary Action Type: This represents the action that can be taken (I.E Open Record)
  • Display Entity: The entity you want to display the card on (I want to show this on the lead record the card is referring to, so I am picking the leads entity here)
  • Display Record ID: The unique id of the lead record we want to show the card on (I am entering the dynamic value ‘Lead’ here)
  • Show For: If you want to show the card in Assistant of the lead owner, you can enter the dynamic value ‘Owner(Value)’ here.
  • Primary Action Entity: This is related to the Primary Action type, this is the entity the action will be related to. Since I want to open the lead when the user clicks on the action button on the card, I am selecting ‘Leads’ for this.
  • Primary Action Record ID: The unique ID of the record the action will be performed on. I will enter the dynamic value ‘Lead’ here again.

    NOTE: If you want to also show the name of the new owner on the card you can do an additional step after the trigger (Get Record) where the entity will be ‘users’ and the item ID will be the dynamic value of ‘Owner(Value)’. This is shown in the youtube video below.

I hope you enjoyed this post! Be sure to check in again next week for a new article or subscribe here to never miss another post!

Share this!

Comments are Closed