Quarantine Chat Bot: Set up an Appointment

I have been talking through how I created a chat bot that I built using Power Virtual Agents to talk to my quarantined parents. We have already looked at how to get started and how to use sentiment analysis to customize responses. Today we are going to set up an appointment!

Power Virtual Agents Appointment
Before getting the scheduling information, I had to ask if they wanted to talk to me.

Getting the TIme

The first step is to figure out when the user (aka my dad) wants to talk to me (aka all the time but that is beside the point). Power Virtual Agents has an option to collect a Date Time. This is super cool because it does recognize text entries, such as “next Monday” and converts to the correct date and time value.

Requesting time in Power Virtual Agents
The Power Virtual Agents bot can request a Date and Time field. The user can enter this in any format or plain text description. This is converted into standard format and then can be passed to Power Automate.

In addition, I set it up to pass along the previous answer of which parent the bot is talking to so that it will know which email address to send the meeting invite to without needing ask who they are again. This makes the bot a bit easier to use (as I am not asking for the email address) but it does make the Flow less reusable due to the hard coded email addresses. The ability to collect more data like email address for more use case flexibility is an enhancement planned for a future release, possibly, Bored Trapped Parents Chat Bot 2.0.

Connecting to Power AUtomate

As we looked at previously, when you call an Action from Power Virtual Agents it will create the template in your new Flow. This template has a step to receive the data from Power Virtual Agents and a step to return output. For my other use cases, my actions would go between those two steps but this is not required.

I wanted to send an appointment approval based on the information gathered from the bot. This cannot be approved while someone is waiting for a bot to respond as it would time out and creates a poor user experience. Instead, we can return back to Power Virtual Agents before we send the approval. This allows the bot to keep running while the approval and following steps process.

Approval in Power Virtual Agents
We are going to receive two pieces of data from the Power Virtual Agent and then immediately return back to the bot. This allows the bot to keep talking while the other steps take place.

Getting Approval

Now we are going to get approval on the time. This is using the out of the box Power Automate Approvals functionality and we are including the Date Time that was captured from the Power Virtual Agent.

If approved, a meeting invite is sent back to the appropriate parent. If not approved, then an email is sent to tell them not to expect an invite but I will talk to them soon.

Power Virtual Agent with Approval
Standard Power Automate Approval is sent using the Date information captured in Power Virtual Agents. Then either an invite will be sent or an “I regret to inform you” email is sent.

And that’s it! The conversation in the bot is still moving along while this approval is going on and everyone is happy.

I am going to finish this series off tomorrow talking about how to review the sessions and share reactions to this bot.

One thought on “Quarantine Chat Bot: Set up an Appointment

Leave a Reply