Chatbots and Power Apps

Chatbots are becoming very popular on websites and in apps. Microsoft has a way to create chatbots using Power Virtual Agents (PVA). Now you can add your chatbot created with PVA directly in a Power App. I played around with this and here is what I found.

Go to PVA and create your chatbot (https://web.powerva.microsoft.com). If you need assistance creating a chatbot, you can follow this handy tutorial from Microsoft. A little tip, if you want to present multiple choice options in a question in the chatbot, you will need to format the question a little differently so the options will display in Power Apps. In the bot designer, add a question. Then click the Add button, and choose Basic Card.

In the Basic Card properties section, click the Add new link to add a choice. Fill out the Text section. Repeat until you have all the options.

In the Identify section, choose the “User’s entire response” option. This will save the user’s choice to a variable that you can process in the next step.

Next, add a Condition node. In the first section, choose your variable from above. Then choose your condition (I used “is equal to”). For your value, click on the arrow, and choose the Formula tab. Type in one of your choices from above and click the Insert button. Repeat as necessary to cover all the choices in your question.

Complete your bot and publish the bot. Next, go to Power Apps (https://make.powerapps.com/) and create a canvas app. In your app Settings, click on the Upcoming features tab and scroll down to the Chatbot component section. Once this is turned on, you will be able to insert your chatbot to the app.

Now when you click on Insert, you should see the Chatbot component. After you insert the component, you will see the list of chatbots in your environment. Click the chatbot you just created. You can resize the chatbot component to your liking.

Play your app and you can interact with your chatbot through your Power App.

I found inspiration for this post on one of my favorite blogs, SharePains by Microsoft MVP Pieter Veenstra. Happy coding!