Exercise - Create and manage topics
Here, you create the conversational flow for your agent.
Create a topic using Microsoft 365 Copilot
Topics can be created and edited using natural language.
Navigate to Microsoft Copilot Studio.
Important
Make sure that you're in the correct environment.
Select your agent in the Agents pane on the left-hand side of the screen.
Select the Topics tab.
Select Add a topic and select Create from description with Copilot.
A new window appears asking you to Name your topic and provide a description in the Create a topic to... text field.
In the Name your topic field, enter the following text:
Customer Details
In the Create a topic to... field, enter the following text:
Ask the customer for their name and email address
Select Create.
A new topic displays with the generated trigger phrases and question nodes.
Note
Remember, your generated content might appear differently than what's shown in this lab.
Select Save.
Update nodes with natural language
If the Edit with copilot pane isn't shown on the right-hand side of the screen, select the Microsoft 365 Copilot icon in the upper part of the authoring canvas.
Select the second question node, What is your email address?
In the Edit with Copilot panel, in the What do you want to do? field, enter the following text:
Update the message in this question node to say thank you to the Name variable from the previous node and then proceed to ask the email address question
Select Update.
Note
The message should be updated to include the Name variable from the message node before it.
Select Save.
Add nodes with natural language
In addition to updating existing nodes, you can use Microsoft 365 Copilot to add new ones.
Make sure that no node is selected by clicking in the empty space around the nodes.
In the Edit with Copilot panel, in the What do you want to do? field, enter the following text:
Summarize the information collected in an adaptive card
Select Update.
A message node with an Adaptive Card is added to the end of the topic.
Select the Adaptive Card. The Adaptive Card properties should appear on the right of the screen.
Your Adaptive Card formula should look similar to the one in the previous image. If it doesn't, then you can copy and paste in the following formula:
{ type: "AdaptiveCard", body: [ { type: "TextBlock", size: "Medium", weight: "Bolder", text: "Summary" }, { type: "FactSet", facts: [ { title: "Full Name", value: Text(Topic.Name) }, { title: "Email Address", value: Text(Topic.EmailAddress) } ] }, { type: "TextBlock", text: "Thank you for providing the information." } ] }
Opening the Adaptive Card properties closes the Edit with Copilot panel; therefore, you need to select the icon to reopen it.
Make sure that no node is selected by clicking in the empty space around the nodes.
In the What do you want to do? field, enter the following text:
Add a new multiple choice question to prompt the user if the details are correct with two options Yes or No
Select Update.
A new question node is added to the end of the topic with options for the user to select.
Select Save.
Configure the scope of the variables
Select Variables to open the Variables pane.
Select the right-hand check boxes for the topic variables.
Select Save.
Author topics manually
Topics can be created manually by adding trigger phrases and nodes.
Create a topic from blank
Select the Topics tab.
Select Add a topic and select From blank.
Select Details to open the Topic details dialog.
In the Name field, enter the following text:
Book a Real Estate Showing
In the Display Name field, enter the following text:
Book
In the Description field, enter the following text:
Select the property and requested date and create a booking request
Select Save.
Select Details to close the Topic details dialog.
Add trigger phrases
Select Edit under Phrases in the Trigger.
Enter
I want to book a real estate showing
under Add Phrases and select the + icon.Enter
Schedule a real estate showing
under Add Phrases and select the + icon.Enter
Arrange the viewing for a real estate property
under Add Phrases and select the + icon.Enter
Set up an appointment to view a house
under Add Phrases and select the + icon.Enter
Plan a property viewing
under Add Phrases and select the + icon.Select Save.
Add a message node
Select the the + icon under the Trigger node and select Send a message.
In the Enter a message field, enter the following text:
Hi, I can help you with booking a real estate property showing.
Select Save.
Add a Topic management node
Select the the + icon under the send a message node and select Add a condition.
Select the DetailsCorrect variable.
Select Topic Management > Go to another topic and select the Customer Details topic.
Select Save.
Add condition node
Select the the + icon under the Redirect node and select Add a condition.
Select DetailsCorrect for variable.
Select is equal to
Select Yes.
Select Save.
Add question nodes
Select the the + icon under the left-hand condition node and select Ask a question.
In the Enter a message field, enter the following text:
Which property do you want to see?
Select User's entire response for Identify.
Select the variable in Save user response as and enter
PropertyName
for Variable nameSelect Save.
Select the the + icon under the question node and select Ask a question.
In the Enter a message field, enter the following text:
What date and time do you want to see the property?
Select Date and Time for Identify.
Select the variable in Save user response as and enter
DateTime
for Variable nameSelect Save.
Test the agent
Select the Test button in the top-right of the screen to open the testing panel.
Select the three dots at the top of the testing panel in the top-right of the screen.
Select Track between topics.
Select the Start a new conversation icon at the top of the testing panel.
When the Conversation Start message appears, your agent starts a conversation. In response, enter a trigger phrase for the topic that you created:
I want to book a real estate showing
The agent responds with the "What is your name?" question.
Enter the following information:
Name: <Your name> Email address: <Your email address>
After you supply the information, an Adaptive Card displays the information that you entered, a question asking if the information is correct, and options to select Yes or No.
Select Yes.
Enter
555 Oak Lane, Denver, CO 80203
to the Which property to you want to see? prompt.Enter
Tomorrow 10:00 AM
to the What date and time do you want to see the property? prompt.
Use entities to improve the agent
Microsoft Copilot Studio uses entities to understand user intent. There are many prebuilt entities included for commonly used information. You can create custom entities for your specific purpose.
View prebuilt entities
Select Settings in the top-right of the screen.
Select the Entities tab.
Create the property type entity
Select + Add an entity and select + New entity.
Select the Closed list tile.
Enter
Property Type
in the Name field.Enter
Apartment
in the Enter item field and select Add.Enter
House
in the Enter item field and select Add.Enter
Condominium
in the Enter item field and select Add.Enter
Duplex
in the Enter item field and select Add.Select + Synonyms for Apartment, enter
Flat
, then select the + icon and select Done.Select + Synonyms for House, enter
Single-family home
, then select the + icon and select Done.Select + Synonyms for Condominium, enter
Townhouse
, then select the + icon and select Done.Select Save.
Select Close.
Create number of bedrooms entity
Select + Add an entity and select + New entity.
Select the Regular expression (Regex) tile.
Enter
Number of Bedrooms
in the Name field.Enter
[1-5]
in the Pattern field.Select Save.
Select Close.
Use entities
Select your agent in the Agents pane on the left-hand side of the screen to return to the Overview tab.
Select the Topics tab.
Select the Book a Real Estate Showing topic.
Select the the + icon above the property question node and select Ask a question.
In the Enter a message field, enter the following text:
What type of property do you want to see?
Select Property Type for Identify.
Select Select options for user and check the Display option for all list values.
Select the variable in Save user response as and enter
PropertyType
for Variable nameSelect the the + icon below the new question node and select Ask a question.
In the Enter a message field, enter the following text:
How many bedrooms do you need?
Select Number of Bedrooms for Identify.
Select the variable in Save user response as and enter
NumberofBedrooms
for Variable nameSelect Save.
Create agent actions
Microsoft Copilot Studio can access data in Microsoft Dataverse using Power Automate cloud flows
Create Power Automate flow to retrieve a property
Select your agent in the Agents pane on the left-hand side of the screen to return to the Overview tab.
Select the Actions tab.
Select + Add an action.
Scroll down and select Create a new flow.
Sign in to Power Automate if prompted.
Select Run a flow from Copilot in the top-left of the screen and enter
Get Property
as the flow name.Select the trigger step Run a flow from Copilot and select + Add an input.
Select Text.
Enter
Bedrooms
for Input andNumber of Bedrooms
for Please enter your input.Select the + icon between the two steps in the flow and select Add an action.
Enter
Dataverse
in the Search field and select See more for the Dataverse connector.Select the List rows action.
If prompted for authentication, select OAuth and select Sign in.
Select Real Estate Properties for table name.
Select Show all.
Enter
contoso_bedrooms eq
in the Filter Rows field.Use Dynamic content to select the Bedrooms parameter and select Add.
Select the Respond to Copilot action and select + Add an output.
Select Text.
Enter
PropertyId
for Enter a name, select the Enter a value to respond with field, and select Insert Expression.Enter the following expression:
first(outputs('List_rows')?['body/value'])['contoso_realestatepropertyid']
Select Add.
Select + Add an output.
Select Text.
Enter
PropertyName
for Enter a name, select into the Enter a value to respond with field, and select Insert Expression.Enter the following expression:
first(outputs('List_rows')?['body/value'])['contoso_propertyname']
Select Add.
Select Settings.
Ensure that Asynchronous Response is set to Off.
Select Save draft.
Select Publish.
Close the Power Automate tab.
Add an agent action for retrieving a property
Select Refresh.
Select the Get Property flow.
Select Next.
Select Next.
Select Finish.
Select the Topics tab.
Select the Book a Real Estate Showing topic.
Select the the + icon below the How many bedrooms do you need question? node and select Call an action.
Select the Get Property flow.
Select the NumberofBedrooms variable for the Bedrooms input parameter.
Select the three dots in the Which property do you want to see? question node and select Delete.
Select the the + icon under the action node and select Send a message.
In the Enter a message field, enter the following text:
Property
Select the Insert variable icon and select the PropertyName variable.
Select Save.
Select Publish and select Publish.
Create Power Automate flow to make a booking
Select your agent in the Agents pane on the left-hand side of the screen to return to the Overview tab.
Select the Actions tab.
Select + Add an action.
Scroll down and select Create a new flow.
Select Run a flow from Copilot in the top-left of the screen and enter
Create Booking Request
as the flow name.Select the trigger step Run a flow from Copilot and select + Add an input.
Select Text.
Enter
PropertyId
for Input andProperty
for Please enter your input.Select + Add an input.
Select Text.
Enter
ViewerName
for Input andViewer Name
for Please enter your input.Select + Add an input.
Select Text.
Enter
ViewerEmail
for Input andViewer Email
for Please enter your input.Select the + icon between the two steps in the flow and select Add an action.
Enter
Dataverse
in the Search field and select See more for the Dataverse connector.Select the Add a new row action.
Select Booking Requests for table name.
Select Show all.
Enter
Agent booking
in the Booking Name field.Enter
contoso_bookingrequests()
in the Property (Real Estate Properties) field, move the cursor within the brackets, and use Dynamic content to select the PropertyId parameter.Use Dynamic content to select the ViewerName parameter for the Viewer Name field.
Use Dynamic content to select the ViewerEmail parameter for the Viewer Email field.
Select the Respond to Copilot action.
Select Settings.
Ensure that Asynchronous Response is set to Off.
Select Save draft.
Select Publish.
Close the Power Automate tab.
Add an agent action for creating a booking request
Select Refresh.
Select the Create Booking Request flow.
Select Next.
Select Next.
Select Finish.
Select the Topics tab.
Select the Book a Real Estate Showing topic.
Select the the + icon below the What date and time do you want to see the property? node and select Call an action.
Select the Create Booking Request flow.
Select the PropertyId variable for the PropertyId input parameter.
Select the Name variable for the ViewerName input parameter.
Select the EmailAddress variable for the ViewerEmail input parameter.
Select the the + icon below the action node. Select Topic management, then select Go to another topic and select End of conversation.
Select Save.
Select Publish and select Publish.
Test the agent and make a booking request
Select the Test button in the top-right of the screen to open the testing panel.
Select the three dots at the top of the testing panel in the top-right of the screen.
Select Track between topics.
Select the Start a new conversation icon at the top of the testing panel.
When the Conversation Start message appears, your agent starts a conversation. In response, enter a trigger phrase for the topic that you created:
I want to book a real estate showing
Enter the following information:
Name: <Your name> Email address: <Your email address>
After you supply the information, an Adaptive Card displays the information that you entered, a question asking if the information is correct, and options to select Yes or No.
Select Yes.
Select House for the type of property prompt.
Enter
2
for the number of bedrooms prompts.Enter
Tomorrow 2:00 PM
to the What date and time do you want to see the property? prompt.Select Yes to the Did that answer your question? prompt.
Select any rating.
Select No to the Can I help with anything else? prompt.
Verify booking request
Navigate to the Power Apps maker portal.
In the left navigation pane, select Tables and select Custom.
Select the Booking Request table.
Under Booking Request columns and data you should see that an agent booking request is now created.