Boost Sales with Copilot: Leverage Opportunity Summaries and Related Records in Dynamics 365 using APIs

By | June 17, 2024

Leverage Opportunity Summaries and Related Records in Dynamics 365

In today’s fast-paced business environment, sales teams need real-time insights and a comprehensive view of their opportunities to make informed decisions and close deals faster. Microsoft’s Copilot for Sales addresses this need by integrating seamlessly with your connected CRM system, providing a unified platform for viewing the latest activities and related records. This blog post delves into the features and capabilities of Copilot for Sales, focusing on how it leverages opportunity summaries and related records within Dynamics 365 to enhance sales efficiency.

1. Viewing Related Activities in Copilot for Sales

The opportunity summary in Copilot for Sales is designed to keep sales representatives informed about the latest activities related to their opportunities. This summary is generated using notes and updates from the timeline of the opportunity record in Dynamics 365. Here’s how it works:

Note: Beyond Dynamics 365, this functionality can be extended to include activities from non-CRM applications, both first-party and third-party. This means you can have a unified view of all related activities, regardless of the application they originate from.

Example: Imagine a sales team at an XYZ company using Dynamics 365 to manage its sales opportunities. The sales representative, Alex, is handling a significant opportunity with a potential client, Fabrikam Inc.

Here’s how Copilot for Sales enhances Alex’s power automate flow:

Please follow the below steps to achieve a Power Automate flow to understand the scenario.
Open https://make.powerautomate.com/ -> Click on My flows -> Select New Flow from the dropdown menu and choose Instant Cloud Flow, as shown in the screenshot below.

Leverage Opportunity Summaries and Related Records in Dynamics 365

After selecting an instant cloud flow, add the flow name -> When a row is added, modified, or deleted -> fill in the details as shown in the screenshot below.

Leverage Opportunity Summaries and Related Records in Dynamics 365

Step 1: Click on the plus icon and select Add an Action -> then search for Copilot: Get Related Activities as shown in the image below.

Leverage Opportunity Summaries and Related Records in Dynamics 365

Step 2: Click on the Sign-in button as shown in the image below-> then Sign-in using your DocuSign Email and Password to create a connection to DocuSign.

Leverage Opportunity Summaries and Related Records in Dynamics 365

Step 3: After Sign-in fill in the required details as shown in the below image.

GetRelatedActivities API Parameters:

  • recordType (String, Required): The entity or object type in the CRM for which related activities are requested. For example, “opportunity.”
  • recordId (String, Required): Unique identifier of the CRM record. For example, “123456.”
  • startDateTime (String, Optional): Start date and time to look up activities.
  • endDateTime (String, Optional): End date and time to look up activities.
  • top (Integer, Optional): Number of activities to fetch.
  • skip (Integer, Optional): Number of activities to skip.
  • crmType (String, Optional): Valid values are Dynamics 365 and Salesforce. Here, it would be “Dynamics 365.”
  • crmOrgUrl (String, Optional): Host name of the CRM organization. For example, “acb123.crm.dynamics.com”.

Leverage Opportunity Summaries and Related Records in Dynamics 365

Now save and trigger the Power Automate Flow, and you will find the output as shown in the screenshot below.

Output Parameters:

  • Value: List of latest activity records from non-CRM applications.
  • HasMoreResults: Indicates if there are more results available.

Here’s an example response for the GetRelatedActivities API:

Leverage Opportunity Summaries and Related Records in Dynamics 365

Sample Output JSON:

{
 "value": [
        {
            "title": "Contract Signed",
            "description": "Fabrikam Inc. signed the product purchase contract on 05/10/2024.",
            "dateTime": "2024-05-10T14:30:00Z",
            "url": "https://app.docusign.com/documents/details/000baf00-2342-42ab-8eff-00000000000",
            "additionalProperties": {
                "Status": "Signed",
                "Owner": "Alex Johnson"
            }
        },
        {
            "title": "Product Demo Scheduled",
            "description": "A product demo with Fabrikam Inc. has been scheduled for 05/15/2024.",
            "dateTime": "2024-05-15T10:00:00Z",
            "url": "https://outlook.office365.com/owa/?ItemID=AAMkAGI2TQ... HYPERLINK "https://outlook.office365.com/owa/?ItemID=AAMkAGI2TQ...&exvsurl=1&viewModel=MyCalItem"& HYPERLINK "https://outlook.office365.com/owa/?ItemID=AAMkAGI2TQ...&exvsurl=1&viewModel=MyCalItem"exvsurl=1 HYPERLINK "https://outlook.office365.com/owa/?ItemID=AAMkAGI2TQ...&exvsurl=1&viewModel=MyCalItem"& HYPERLINK "https://outlook.office365.com/owa/?ItemID=AAMkAGI2TQ...&exvsurl=1&viewModel=MyCalItem"viewModel=MyCalItem",
            "additionalProperties": {
                "Status": "Scheduled",
                "Organizer": "Alex Johnson"
            }
        }
    ],
    "hasMoreResults": false
}

Opportunity Summary in Action:

Alex accesses the opportunity record for Fabrikam Inc. in Dynamics 365. Utilizing Copilot for Sales, he instantly views the latest activities associated with the opportunity, sourced from Dynamics 365. This encompasses a scheduled meeting with Fabrikam’s procurement team, an email from their CEO requesting a product demo, and notes from a recent call with their IT department regarding integration capabilities.

Furthermore, Copilot for Sales expands its functionality to include activities from non-CRM applications like DocuSign and Outlook. Alex receives updates on a signed contract from DocuSign and a follow-up email in Outlook from Fabrikam’s legal team. These extended capabilities can be implemented using the GetRelatedActivities API by developers.

2. Viewing Related Records in Copilot for Sales

Another powerful feature of Copilot for Sales is the ability to view related records when accessing the details of a CRM record. This capability can also be extended to show related records from non-CRM applications, providing a comprehensive view of all relevant data.

Example: When Alex views the opportunity record for Fabrikam Inc., Copilot for Sales can display related records such as previous contracts, support tickets, and additional documentation from various systems.

To enable this, developers can implement the GetRelatedRecords API.

Please follow the below steps to achieve a Power Automate flow to understand the scenario.
Open https://make.powerautomate.com/ -> Follow the above triggering condition used in the GetRelatedActivities API for opportunity entity. Then,

Step 1: Click on the plus icon and select Add an Action -> then search for Get Related Records as shown in the image below.

Leverage Opportunity Summaries and Related Records in Dynamics 365

Step 2: Click on the Sign-in button as shown in the image below-> then Sign-in using your DocuSign Email and Password to create a connection to DocuSign.

Leverage Opportunity Summaries and Related Records in Dynamics 365

Step 3: After signing, fill in the required details as shown in the below image.

GetRelatedRecords API Parameters:

  • recordType (String, Required): The entity or object type in the CRM for which related records are requested. For example, “opportunity.”
  • recordId (String, Required): Unique identifier of the CRM record. For example, “123456.”
  • top (Integer, Optional): Number of activities to fetch.
  • skip (Integer, Optional): Number of activities to skip.
  • crmType (String, Optional): Valid values are Dynamics 365 and Salesforce. Here, it would be “Dynamics 365.”
  • crmOrgUrl (String, Optional): Host name of the CRM organization. For example, “acb123.crm.dynamics.com.”

Leverage Opportunity Summaries and Related Records in Dynamics 365

Now save and trigger the Power Automate Flow, and you will find the output as shown in the screenshot below.

Output Parameters:

  • value: List of related records from non-CRM applications.
  • hasMoreResults: Indicates if there are more results available.

Here’s an example response for the GetRelatedRecords API:

Leverage Opportunity Summaries and Related Records in Dynamics 365

Sample Output JSON:

{
    "value": [
        {
            "recordId": "000baf00-2342-42ab-8eff-00000000000",
            "recordTypeDisplayName": "Contract",
            "recordTypePluralDisplayName": "Contracts",
            "recordType": "contract",
            "recordTitle": "Product Purchase Contract",
            "url": "https://app.docusign.com/documents/details/000baf00-2342-42ab-8eff-00000000000",
            "additionalProperties": {
                "Status": "Signed",
                "Owner": "Alex Johnson"
            }
        },
        {
            "recordId": "000baf11-2342-42ab-8eff-00000000000",
            "recordTypeDisplayName": "Support Ticket",
            "recordTypePluralDisplayName": "Support Tickets",
            "recordType": "support_ticket",
            "recordTitle": "Integration Issue",
            "url": "https://support.xyz.com/tickets/000baf11-2342-42ab-8eff-00000000000",
            "additionalProperties": {
                "Status": "Resolved",
                "Owner": "Sam Williams"
            }
        }
    ],
    "hasMoreResults": false
}

By utilizing these parameters, developers can ensure that Copilot for Sales provides a comprehensive and unified view of all related records, enhancing the efficiency and effectiveness of sales teams.

This was the classic approach to integrating Dynamics 365 CRM with DocuSign for using related records and related activities with Power Automate:

  • Trigger: When a Record is Created or Updated for “Opportunities.”
  • Get Record Details: Retrieve opportunity details.
  • Get Related Records: Fetch primary contact related to the opportunity.
  • Get Activity Records: List activities related to the opportunity.
  • Create and Send DocuSign Envelope: Send a document for signing.
  • Monitor DocuSign Envelope Status: Loop until the envelope status is “completed.”
  • Get Envelope Status: Check envelope status.
  • Update CRM Record Status: Set opportunity status to “Signed” if the envelope is completed.
  • Retrieve Signed Document: Get the signed document from DocuSign.

This Power Automate flow integrates Dynamics 365 CRM with DocuSign to automate the document signing process. The latest flow is faster, more optimized, and uses fewer resources. It ensures efficient handling of opportunity records, real-time status updates, and centralized management of signed documents. In contrast, the older flow is slower due to the additional looping statements needed to retrieve related records and activities.

Conclusion

Copilot for Sales enhances the capabilities of sales teams by providing real-time, comprehensive views of opportunities and related records. By leveraging the GetRelatedActivities and GetRelatedRecords APIs, organizations. can integrate activities and records from both CRM and non-CRM applications, creating a unified and efficient sales workflow or power automate flow. This integration not only saves time but also ensures that sales representatives like Alex have all the information they need at their fingertips, ultimately driving better sales outcomes.

Experience the power of Dynamics 365 and Power Platform with Copilot!

Stay ahead with the latest updates in Copilot, integrating Microsoft Copilot into your developments. Connect with us at crm@inogic.com for personalized AI-enabled solutions tailored to your business needs.