CREATE COPILOT TOPIC (Part 2)

In this blog, we will leverage Copilot and Power Automate to create a customer account in D365 FO based on the trigger phrase that the user has entered followed by questions for further information.

A quick peak into what it looks like in the end,

 

As soon as a user enters the trigger phrase, Copilot will call the custom topic created and start asking subsequent questions as shown below,

 

Alright having said this, let's begin!

 

I. CREATE TOPIC UNDER COPILOT FOR FINANCE AND OPERATIONS

Navigate to Copilot for finance and operations, and create new topic,

Analytics 
Copilots 
Copilots 
Custom copilots 
Sales Copilot Power Virtual Ag... 
Customer Service Copilot 30t 
Copilot for finance and operati... 
Copilot for Inventory Visibility 
• Microsoft 
Copilot for finance and operatio... 
Overview Knowledge Topics Actions 
C) Your free trial expires in 13 day(s). Contact your admin to discoverthe plan that's right for you. 
+ Add a topic 
All QA Custom (12) System (9) 
Channels 
Errors 
Published 5/27/2024 
Publish 
Settings 
Test 
• Test your copilot 
Search custom topics 
Last refreshed now 
Name 
AppCopilot.C... 
AppCopilot.D... 
Trigger 
Event received 
Phrases 
Description 
Editing 
Last modified 
S days 
S days

 

Click on 'Add a topic',

Copilots 
Custom copilots 
Sales Copilot Power Virtual Ag... 
Customer Service Copilot 30t 
Copilot for finance and operati... 
Copilot for Inventory Visibility 
Microsoft 
Copilot for Microsoft 365 
Copilot for Sales 
Copilot in Dynamics 365 Custo... 
Coming soon 
Copilot for finance and operatio... 
Overview Knowledge Topics Actions 
C) Your free trial expires in 13 day(s). Contact your admin to discoverthe plan that's right for you. 
+ Add a topic 
From blank 
Create from description with Copilot 
Analytics 
Channels 
Errors 
Published 5/27/2024 
Publish 
Settings 
Test 
• Test your copilot 
Search custom topics 
Last refreshed now 
Name 
AppCopilot.C... 
AppCopilot.D... 
AppCopilot.N... 
AppCopilot.P... 
AppCopilot.Pr... 
AppCopilot.S... 
Q AppCopilot.S... 
Trigger 
Event received 
Phrases 
Event received 
Event received 
On Redirect 
Phrases 
Event received 
Description 
Editing 
Last modified 
S days 
S days 
S days 
S days 
S days 
S days 
S days

 

As you can see, copilot offers two options when creating a new topic,

- From blank

- Create from description with copilot

 

In our case, we will use the 'Create from the description with copilot' option. Enter a name for your topic and a quick description as shown below,

Create from description with Copilot 
Write a description of what youd like your copilot to cover, and Copilot will create your topic. Learn more 
Name your topic 'k 
Create a customer account 
Create a topic to... •k 
Create a customer record in D36SFO. 
Al-generated content can have mistakes. Make sure It's accurate and appropriate before using it. Read terms 
Or try one of these examples to get started 
C) Let someone order a pizza, choosing from common pizza types and how many they want to order. 
C) Accept a user's name, age and date of birth and then repeat their responses back to them. 
C) Collect a user's street address, state and zip code. The user should be able to retry each question up to 4 times. 
What does Copilot suzport? 
C) View more examples 
Create 
Cancel

Note:

  In my case, I am unpinning the copilot section and test section for a better view of the canvas for editing,

 

Copilot for finance and operations apps Overview Knowledge Topics 
C) Your free trial expires in 13 day(s). Contact your admin to discoverthe plan that's right for you. 
Vsrisblu 
Actions 
Analytics 
Channels 
Published 5/27/2024 
Copilot 
Publish 
Settings 
Test 
Create a customer account 
Topic 
Edit with Copilot 
Move nodes in the canvas. To make additions 
and changes to nodes, tell Copilot what you 
want to do. Learn more 
What do you want to do? 
Explain what yau want to change or add 
from the topic. Select a node to be more 
Trigger 
Phrases 
o 
Phrases 
create customer account 
register as a customer 
sign up for an account 
new customer registration 
customer account creation 
@ Message 
To create a customer record in D36SFO 
S 
specific. 
Update 
No nodes selected 
, you... 
What you asked for 
"Create a customer record in D365FO." 
What we added 
Send activity 
To create a customer record in D365FQ y... 
Examples that work 
Add a question to ask the user for their 
name. 
Summarize the information gathered from 
the user in an Adaptive Card. 
Add a question to ask the user to choose 
their preferred contact method, choosing 
from email, telephone or SMS.

Since I selected the second option while creating the topic, it gave me different phrases that essentially would act as a trigger.

 

Click on '+' under the trigger and navigate to 'Ask a question',

Trigger 
Phrases 
o 
Phrases 
create customer account 
register as a customer 
sign up for an account 
new customer registration 
customer account creation 
Paste 
Send a message 
Ask a question 
Ask with adaptive card 
Add a condition 
Variable management 
Topic management 
Call an action 
Advanced

Add a question. In this case, the question would be 'What will be the customer's name?'.

 

Change identification to 'User's entire response', this means, anything user types will be considered as customer name, there are different options which we will see in future blogs.

 

Change the save user response as 'String' and provide the variable name as 'CustomerName'.

Question 
-k Add v 
What will be customer name? 
Identify 
User's entire response 
Save user response as 
(x) CustomerName string 
Text v

You can define variable properties on the right side pane as below,

Variable properties 
Variable name 
CustomerName 
Type 
string 
Reference 
Question 
What will be customer name? 
Typé (string) fmm 
View all references 
Usage 
@ Topic (limited scope) 
Receive values from other topics 
Return values to original topics 
O Global (any topic can access) 
x

 

Repeat this step for currency, language and customer group.

 

Note: Remember to provide a different variable name for each of these nodes (Questions) so we can pass on this information to Power Automate Flow.

 

Now the overall topic's flow will look as below,

 

Question 
What be customer name? 
Identify 
Users entire response 
Save user response as 
CustomerNzme string 
Question 
What be customer group? 
Identify 
Users entire response 
Save user response as 
CustomerGroup string 
D Question 
What is customer currency? 
Identify 
Users entire response 
Save user response as 
CustomerCurreru:y 
string D Question 
What be Customer language? 
Identify 
Users entire response 
Save user response as 
@ Message 
stri 
To create customer record in DSESFO, you...

 

Click on '+' under the trigger, and navigate to call an action and click on 'Create a flow' as shown below,

 

Copilot for finance and operations apps 
Create a customer account 
Paste 
S 
Overview 
Knowledge 
Topics 
Actions 
Analytics 
Channels 
Save user response as 
CustomerCurreru:y 
D Question 
Published 5/27/2024 
Publish 
Settings 
Test 
string 
Select an action 
Copilot 
Plugin (preview) 
Vsrisblu 
x 
Topic 
Edit with Copilot 
Move nodes in the canvas. To make additions 
and changes to nodes, tell Copilot what you 
want to do. Learn more 
What do you want to do? 
Explain what yau want to change or add 
from the topic. Select a node to be more 
What be Customer language? 
Identify 
Users entire response 
Save user response as 
specific. 
Update 
No nodes selected 
string 
Basic actions 
p Search 
Connector (preview) 
Send mess.ne 
Ask question 
Ask wqt.h 
Add condition 
mansgen-ent 
management 
CSI •ctj•or 
Advanced 
010 
010 
010 
010 
Create a flow 
Launches Microsoft Flow 
Create a prompt 
Creates a prompt in Power Apps Al Hub 
Skill or Skill action 
Go to Skills to add a skill to your copilot 
Inventory On-hand 
Updated 22 days ago 
Run a flow from Copilot and send back a response. 
Run a flow from Copilot 
Updated G month ago 
Run a flow from Copilot and send back a response. 
Run a flow from Copilot 
Updated G month ago 
Run a flow from Copilot and send back a response. 
Run a flow from Copilot 
What you asked for 
"Create a customer record in D365FO." 
What we added 
Send activity 
To create a customer record in D365FQ yo... 
Examples that work 
Add a question to ask the user for their 
name. 
Summarize the information gathered from 
the user in an Adaptive Card. 
Add a question to ask the user to choose 
their preferred contact method, choosing 
from email, telephone or SMS. 
Al-generated content can have mistakes. Make sure 
it's accurate and appropriate before using it. Read 
terms 
This isn't what I'm looking for

 

This will open a power Automate window in another tab. In the next step, we will look at creating a power Automate flow to create a customer account in D365 FO.

 

 

II. CREATE POWER AUTOMATE FLOW

Power Automate will populate two nodes automatically since the flow was called from the copilot as shown below,

 

Click on 'Run a flow from Copilot' and change the name to 'Copilot Create Customer Account' so it's easier to identify in the Copilot Studio later.

Run a flow from Copilot 
Send feedback 
Run a flow from 
Copilot 
o 
Respond to Copilot 
(t) Copilot 
Version history 
29 Flow checker 
Save draft 
Test 
Publish 
New designer

 

Click on 'Run a flow from copilot', this will open a pane on the left side where you can provide inputs.

 

In this case, we will add inputs for Customer Name, Customer Group, Customer Language and Customer Currency as shown below,

Run a flow from Copilot 
Run a flow from Copilot 
Send feedback 
(t) Copilot 
Version history 
29 Flow checker 
Save draft 
Test 
Publish 
New designer 
Parameters 
Settings 
Code View 
About 
O 
CustomerNa... 
O 
CustomerGro... 
O 
CustomerLan... 
O 
CustomerCur... 
-4- Add an input 
Please enter your input 
Please enter your input 
Please enter your input 
Please enter your input 
Run a flow from 
Copilot 
o 
Respond to Copilot

 

Click on '+' after 'Run a flow from copilot' and click on 'Add an action' as shown below,

Run a flow from 
Copilot 
Add an action 
Add a parallel branch 
o 
Respond to Copilot

 

When you select 'Add an action', Power Automate will pop up a pane on the left-hand side.

 

In the search box enter 'Create record', it will show different options.

 

Select 'Create record' under Fin & Ops Apps (Dynamics 365) as shown below,

4— Copilot Create Customer Account • Draft 
@ We saved your draft flow. You can test and run it after you publish. 
Send feedback 
Copilot 
Version history 
Flow checker 
Save draft 
Test 
Publish 
New designer 
Add an action 
p 
create a record 
Runtime 
Select a runtime 
Group by Connector 
Create file 
Create share link 
Create share link by path 
Fin & Ops Apps (Dynamics 365) 
Create record 
Planner 
Create a task 
Create a task 
Create a bucket 
Action Type 
Actions 
G) 
See more 
See more 
Preview G) 
Run a flow from 
Copilot 
Respond to Copilot

Now that you have selected the 'Create record' option, select the node 'Create record'. This will open a pane on the left side.

 

In this pane, select the Instance where you want the record to be created, followed by an entity; in this case, we will select 'CustomersV3' for creating the customer record. 

 

Once you save the Power Automate draft, it will pop up mandatory fields for creating a customer record as shown below,

4— Copilot Create Customer Account • Draft 
@ We saved your draft flow. You can test and run it after you publish. 
Create record 
Send feedback 
Copilot 
Version history 
Flow checker 
Save draft 
Test 
Publish 
New designer 
Parameters 
Instance 
Entity Name 
Settings 
Code View 
Testing 
About 
CustomersV3 
Currency 
Customer... 
Customer Group 
Customer... 
Company 
USMF x 
Customer Account 
91901 x 
Advanced parameters 
Showing 4 of 292 
Name 
Customer... 
Name 
Customer... 
Organization Name 
Customer... 
Run a flow from 
Copilot 
Create record 
o 
Respond to Copilot 
Show all

 

Select the input fields we created in Step on 'Run a flow from copilot' respectively. Eg. Currency will have a 'CustomerCurrency' input field and so on.

 

For this example, we will select the default legal entity as 'USMF' and the Customer account number as '99887766',

 

Note: I had to change this as there was another customer with '91901', my flow was erroring out.

 

Once you have completed the required steps. Select 'Response to Copilot' node, the power automate will open pane on left, in this case we will return parameters back to Copilot Studio Topic as shown below,

 

4— Copilot Create Customer Account • Draft 
@ We saved your draft flow. You can test and run it after you publish. 
Respond to Copilot 
Send feedback 
Copilot 
Version history 
Flow checker 
Save draft 
Test 
Publish 
New designer 
Parameters 
Settings 
Code View 
About 
Customer Ac... 
Customer Na... 
+ Add an output 
Customer 
Name or d... x 
earch 
Create record 
Compa m,' 
The dataAreaId attribute. 
Customer account 
The CustomerAccount attribute. 
Cur rency 
The SalesCurrenc)Code attribute. 
Customer group 
The CustomerGroupId attribute. 
Body 
o 
Run a flow from Copilot 
CustomerName 
Please enter your input 
CustomerGroup 
Please enter your input 
CustomerLanguage 
Please enter your input 
CustomerCu rren 
see More (305) 
Run a flow from 
Copilot 
Create record 
o 
Respond to Copilot

 

In this case, we will return the customer account number and customer name.

 

Save the flow and publish (do not forget to publish).

 

Now that we have completed the creation of Power Automate, let's head back to updating Copilot Studio in the next step.

 

 

III. UPDATES TO TOPIC BASED ON AUTOMATE FLOW

Now that the Power Automate step is completed. 

 

In the Copilot for Finance and Operations apps Click on '+' under the customer language question, navigate to 'Call an action' and select the flow created in the earlier step,

Copilot for finance and operations apps Overview Knowledge Topics 
C) Your free trial expires in 8 day(s). Contact yur admin to discover the plan that's right for you. 
Create a customer account 
Actions 
Analytics 
Cop.ilots 
Channels 
Copilot 
x 
Published 6/24/2024 
Publish 
Settings 
Test 
O 
V. risblu 
Topic 
What will be Customer language? 
Identify 
User's entire response 
Select an action 
Basic actions 
p Search 
Connector (preview) 
Plugin (preview) 
Save user response as 
(x) Customerlanguage 
string 
To O 
S 
Paste 
Send a message 
Ask a question 
Ask with adaptive card 
Add a condition 
Variable management 
Topic management 
Cell an action 
Advanced 
010 
010 
010 
Create a flow 
Launches Microsoft Flow 
Create a prompt 
Creates a prompt in Power Apps Al Hub 
Skill or Skill action 
Go to Skills to add a skill to your copilot 
Copilot Create Customer Account 
Updated an hour ago 
Inventory On-hand 
Updated G month ago 
Run a flow from Copilot and send back a response. 
Run a flow from Copilot 
Updated G month ago 
Run a flow from Copilot and send back a response. 
Run a flow from Copilot 
Updated G month ago 
• Test your copilot 
Ask a question or describe what you need 
Make sure Al-generated content is accurate and appropriate 
before using. See terms

It should bring below screen where you can enter user inputs that will be passed on to customer flow,

Copilot for finance and operations apps Overview Knowledge Topics 
O Your free trial expires in 8 day(s). Contact yur admin to discover the plan that's right for you. See pricing 
Create a customer account 
Cop.ilots 
Actions 
Action 
Analytics 
Channels 
Published 6/24/2024 
Publish 
Settings 
Test 
O 
Copilot 
V. risblu 
Topic 
S 
Power Automate inputs (4) 
CustomerName (String) 
CustomerName string 
CustomerGroup (String) 
CustomerGroup string 
CustomerLanguage (String) 
Customerlanguage string 
CustomerCurrency (String) 
CustomerCurrency string 
Copilot Create Customer Account 
010 
View flow details 
Outputs (2) v 
customer_account string 
CustomerAccount string 
customer_name string 
CustomerName string 
• Test your copilot 
Ask a question or describe what you need 
Make sure Al-generated content is accurate and appropriate 
before using. See terms

Click on 'Message' box and provide details back to users for further information,

Actions 
Cop.ilots 
Copilot for finance and operations apps Overview Knowledge Topics 
C) Your free trial expires in 8 day(s). Contact yur admin to discover the plan that's right for you. See pricing 
Create a customer account 
S 
Analytics 
Channels 
Published 6/24/2024 
Publish 
Settings 
Test 
O 
Copilot 
Vsrisblu 
Topic 
Outputs (2) v 
{x) customer_account string 
(x) CustomerAccount string 
{x) customer_name string 
(x) CustomerName string 
@ Message 
Add v 
Customer with name 
Text v 
(x) fx 
(x) CustomerName string is created 
with customer account number as 
(x) CustomerAccount string 
• Test your copilot 
Ask a question or describe what you need 
Make sure Al-generated content is accurate and appropriate 
before using. See terms

Once you enter the details in the message.

 

Save and publish the topic.

 

Note: If the Topic is not published, it will not take effect and will not be called in the sidecar in D365 FO.

 

IV. PROCESS TOPIC IN THE SIDECAR

Now that we have completed creating and publishing the topic.

 

Navigate to D365 FO and click on sidecar as shown below,

USMF 
Demand planning 
Invoice capture 
Purchase order receipt 
and follow up 
Recruitment 
management 
Released product 
maintenance 
Resource lifecycle 
management 
ail and Commerce IT 
Sales order processing 
and inquiry' 
Sales retum processing 
Store financials 
p 
O 
Copilot 
Have a question 
about this app? Ask 
Copilot. 
Copilot can answer questions 
about app functionality and 
features, including 
troubleshooting guidance. It's 
always learning from your 
feedback, If you're not sure where 
to start, ask what Copilot can do 
for you. 
Ask a question about the data in 
this app, or tell me what you're 
looking for 
Make sure Al-generated content is 
accurate and appropriate before using. 
See term s

 

Enter any phrase from the trigger. In this case, I will enter 'Create customer'. This will trigger the copilot topic we created as shown below,

What will be customer name? 
ted m.y 
Copilot customer 
What will be customer group? 
ted m.y

As I enter details, Copilot will start asking subsequent questions from the topic,

 

Once the copilot and flow complete the flow, it will create a customer record as shown below,

a Edit + Nev.' 
nts 
Contacts v 
Delete Customer 
Sell Invoice Collect 
Forecast 
Projects Service Market Commerce 
General Credit management Recurring contract billing Options P 
Transactions 
Global transactions 
Name 
337k: accounts 
Summary update 
Credit eras 
product titers 
Attic h mer,ts 
Send catalog 
Cwto m 
Customer service 
Registrztion DS 
Registrztion search 
TBA exempt number search 
Extension 
Ekctrcr,ic document properties 
Rebate 
Charge party association 
All customers 
Standard view * 
p Filter 
C) Account 
99887766 
Customers advanced notes setup 
Invoice account 
Customer group 
Currency 
USD 
Telephone 
Is merged 
Copilot customer 
Created date and time 
6/24/2024 PM

And that's how you can connect Copilot and Power Automate with D365 FO to create a customer record.

 

Thank you for visiting!