DJ Bot - The bot who spins Dad Jokes - Part 2 - The Design

At Power Platform Saturday, Sydney conference, I presented this session “DJ Bot, the bot who spins Dad Jokes” with my son Dinel to a group of smart and enthusiastic young people.  This blog post series is based on learnings from building a conversational bot using Microsoft’s Power Virtual Agents and Power Automate products to spin dad jokes.  This is Part 2.

Check out the first article of this series – DJ Bot, the bot who spins Dad Jokes – Part 1 – Overview

The Design

The design of the DJ bot includes 3 products.

  1. Power Virtual Agents – This is the bot.
  2. Power Automate – A workflow tool with hundred’s of connectors to design logical flows.  This is used to extract jokes from a storage location.
  3. Excel Online – In this solution, I used an Excel file saved in Excel Online to store my dad joke database.

The high-level design of the solution is as follows.

DJ Bot - Design

In this design, I have created 4 Topics.

  1. Start – This kicks off the bot when the user types a greeting such as “Hi” or “Hello”.
  2. Tell a joke – This topic is the core topic which will;
    1. Ask the user if they would like to hear a joke
    2. Fetches a joke
    3. Display the joke
    4. Get user input
    5. Display the punch line
  3. Loop – PVA doesn’t allow redirecting to itself.  To create an infinite joke loop, I redirect the “Tell a joke” topic to “Loop” topic and then redirect “Loop” topic to “Tell one joke” topic.
  4. Goodbye – If the user clicks on “No” button when the question was asked, “Would you like to hear a joke?” or if the user types “I’ve had enough”.

Navigating PVA

Let’s have a quick look at some of the key components of the interface.

Menu

Left navigation menu allows you to create/update Topics and Entities, see how your bot performs using Analytics, and publish and manage channels.

Test Bot

The Test Bot is a fantastic feature.  This allows you to test your design as you build.  If you can’t see the Test Bot, click on the purple bot icon on the bottom left corner.  Make sure to enable “Track between topics”.   If you bot has redirections to other topics or based on user input the topic changes, when testing the bot the interface moves between topic designs and marks the executed step as the conversation flows.

See the testing in action.

Authoring Canvas

Authoring Canvas is the design interface.  This is where you design the conversation of the bot.  Designing a Power Virtual Agent (PVA) bot is super easy.  PVA provides a tool called Authoring Canvas.  This is easy to use the no-code design interface to design the conversation flow of the bot.  Testing the bot is as easy as designing.  As you add new steps, you can test the bot within the same window.  Note:  Please make sure to hit the “Save” button as you go.

Navigating PVA

Adding a step

To add a new step, click on the “+” button.  If you want to insert a step in between two steps, hover over the line between the steps (closer to the top step), the “+” button will appear.

Add Step

Topic – Tell one joke

Tell one joke topic is the engine of the DJ Bot.  See the design of the topic below.

Tell one joke design

In the next articles, I will demonstrate how I integrated Power Virtual Agent with Power Automate.

DJ Bot, the bot who spins Dad Jokes – Part 3 – Integrating Power Virtual Agent with Power Automate

References

Docs – Key concepts – Authoring Power Virtual Agents bots – https://docs.microsoft.com/en-us/power-virtual-agents/authoring-fundamentals

Thank you for visiting Dyn365Apps.com.

Follow me on Twitter – 

Until next time…

About the Author

Nadeeja Bomiriya is a Microsoft MVP, Chapter Lead – Dynamics 365 and Power Platform Saturday – Australia, Sri Lanka, Committee Member – Melbourne Dynamics 365 User Group, Technical Architect, and Dynamics 365 Practice Lead who lives in Melbourne, Australia.

Disclaimer: This blog post contains opinions of my own and not the views of my employer.

DJ Bot, the bot who spins Dad Jokes – Part 2 – The Design