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:
- Start of with asking yourself a couple of questions before you build your own Copilot.
- Then connect your Copilot to SharePoint to quickly make your Copilot intelligent.
- Now go ahead and use the build-in Copilot of Copilot Studio to quickly create a custom topic.
- Create dynamic options in a question node by utilizing the JSON function.
- Finish off the topic and learn how to add Rich Media to a message.
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.

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.

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.

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:

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)

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!

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.

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.
