web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Trigger Copilot in D365 Sales Prompts via API (Power Automate)

Tom_Carrisi Profile Picture Tom_Carrisi

In this blog post, we will demonstrate how to incorporate outputs or generated content from Copilot in D365 Sales prompts for automated scenarios.

For instance, consider a seller who wishes to be informed about updates to an opportunity they manage or to receive notifications when the opportunity's status changes. As part of these notifications, you can include the opportunity summary, providing a clearer understanding of the record and saving the seller the time and effort required to navigate to the record itself.

Many of the out of the box prompts within Copilot in D365 Sales are outbound actions, meaning they can be invoked via API. These Outbound Actions can be selected within Power Automate, but also you can discover more information on them by using the following API, you can discover more information on Custom API properties in this article:

CustomAPI tables (Microsoft Dataverse) - Power Apps | Microsoft Learn

For example, to find more information on the Opportunity Summary:

[YourOrg].[YourRegion].dynamics.com/api/data/v9.2/customapis?$select=uniquename,description,displayname&$expand=CustomAPIRequestParameters($select=uniquename)&$filter=uniquename eq 'msdyn_SalesOpportunitySummary'

Example Response:

Now, we can also execute Custom Actions from Power Automate, meaning we can trigger these prompts in automated scenarios. 

1. Lets create Flow for when an Opportunity is modified, we would likely further filter this down for a status change etc but for demonstration purposes lets keep this simple


2. We now trigger the Sales Opportunity Summary prompt, which is an Outbound Action, passing in the Opportunity Id.


3. Now we take the the generated summary form the outbound action and pass into the compose script


4. Finally, we send the output of the compose action into the body of an email, which will send an adaptive card of the opportunity summary by email 


Here is an example of the email received: 


In this simple example, we have provided a step by step instructions of how to use the Copilot in D365 Sales Opportunity Summary Prompt from Power Automate 


img widget

Comments

*This post is locked for comments