Rich Media Response says more then a 1000 words

Shows an image of different kind of holiday types

When building out topics manually for Power Virtual Agents we have all the control in the world. This means we can also present information in a way that makes sense and is appealing. In this blogpost I will continue on with my example topic of requesting days off. We will start by talking about how to make the request to our external system. After I’ll will utilize the ability to add rich media to our response to wish someone a happy holiday.

This post is part of a series of blogpost about Copilot Studio in which I create a HR Copilot and show various options available within Copilot Studio. Here are my other posts about this topic:

Submitting your request

In my previous post we talked about utilizing Power Automate to call our external HR system and in this case Power Automate is our friend again. Obviously when we have an HR system we want to add the request immediately to that system. There are quite a few connectors available and if your HR system is not available, you can always build your own custom connector.

Seeing as this is not a post about Power Automate I will not go into the details of the Cloud Flow but I do want to give you some pointers. Within Power Automate we again have full flexibility. We can find someone’s manager by utilizing the Office 365 User connector. And Power Automate has a nice Approval feature where you can create a workflow that will request someone’s approval before you enter it in the HR System.

Shows the Flow designer where the blocks "When Agents calls a flow", "Start and Wait for an Approval" and "Return Value" are in the wrong order
Wrong Order Cloud Flow

If you are using an approval step, don’t make the same mistake I made. There’s a right way of ordering the blocks in Power Automate and a wrong way. If the approval step is before the return value step of your Cloud Flow then the bot will not respond until approval has been given! This obviously will take longer then you’d like 😅 In fact, it’s good practice in Cloud Flows to give response back to the user as soon as possible.

Shows the Flow designer where the blocks "When Agents calls a flow", "Return Value" and "Start and Wait for an Approval" are correctly ordered
Correct Order Cloud Flow

Power Fx to the rescue

Now in any case you want to submit the information gathered in your topic along with the user’s email adres to your Power Automate cloud flow. For this we define input parameters. We can choose among 3 options: Text, Yes/No and a Number.

Shows the input parameters of the Cloud Flow with Startdate, Enddate, Leave Type and User Email as string inputs.
Input Parameters Cloud Flow

This is fine on first glance but when we want to call this Cloud Flow in our topic, you will notice we cannot put a date in there:

Shows that we cannot bind the answers of the questions we have in our topic to the Cloud Flow we want to call
Error Calling Flow – Incorrect Data Type

Luckily we can utilize Power Fx and do a conversion of the date value to text. You can reference any variable in your topic (or even global) within this window. Keep that in mind when you want to do more advanced stuff. The Power Fx formula we use is: Text(Topic.Startdate)

Shows the formula tab in the Topic designer of Copilot studio where the formula is shown to convert a date to text.
Power Fx Date to Text

To grab the current users email address we need to navigate from the custom tab to the system tab. Here you’ll find the users email address variable.

Add Rich Media to the respons

The user has requested their leave, now it’s time to confirm that it has been requested. You can do this by a simple message stating: “Your leave request has been submitted to our system”. But where is the fun in that? Your employee just submitted a holiday request which they are probably excited about! Now this only makes sense for the correct leave type, so be sure to add a condition. Else things might get awkward soon! You don’t want to wish someone a happy holiday if they are taking their paternity leave!

Shows a part of the topic we designed in Copilot Studio to only show the image when a user requests a holiday
Condition send message with image

Adding a image or movie is done by pressing add on a normal message. Let’s wish them a nice holiday by adding a picture to our message. We define what picture to send by adding the url in the property pane. on the right. At this time it is not possible to upload an image.

Shows the message box where we add a image to make the topic more engaging and interesting for our users
Holiday message

And that’s it! Our topic is done. A user can now request day off by using the HR Copilot. We can grab dynamic option values. Use Power Automate to connect to our HR system or utilize the approval system. Use Power Fx to transform values and make our Copilot more engaging by adding images.

Shows the test pane of Copilot Studio where we can see the end result of the topic we created
End result of our topic

Leave a Reply

Your email address will not be published. Required fields are marked *