Notify primary contact of case with a proactive message

A lot of great Power Virtual Agents announcements at Ignite. Notify team users with proactive messages is now in public preview. In this article I am using proactive messages to retrieve details from a primary contact of a Dynamics 365 Customer Service case (incident).

Waiting for Details

In this example I am using the case (incident) table from Dynamics 365 Customer Service as an example. When a status of a case is set to Waiting for Details the owner requires more details from the primary contact.

The idea is to retrieve the last note (annotation) and use this to notify the primary contact about this via a proactive message with an adaptive card from the Power Virtual Agent. The response will be stored in a new note and the status of the case will be updated to In Progress.

notification_pva_test_trigger

Prerequisites for this example

Before you start it is good to know that these bits were created for this example.

1. Create Power Virtual Agents bot, which is used in the configuration of the Adaptive card action.
2. Add a chatbot to Microsoft Teams, the bot is installed in Teams so we can chat with it.

Flow setup

notification_pva_flow

1. When a row is added, modified or deleted trigger action. Select the Cases table and make sure you only trigger it when the statuscode is set to Waiting for Details (3).

whenarowismodified

2. Add a Get a row by ID action. Select the Contacts table. Use the Contact (value) for the Row ID.

getcontact

3. Add List rows actions. Select the Notes table. Filter on the related case and only retrieve the last one.

getlastrelatednote

4. Add a Html to text action. Use the expression from the code snippet below.

htmltotext_notetext

5. Add a Post adaptive card and wait for a response action. Select Post as Power Virtual Agents (Preview) and Post in Chat with bot. Use the code snippet below for the Message.

postas_pva

6. In the Post adaptive card and wait for a response action make sure you use the Email property from the Get row by id action. Select the Power Virtual Agent you want to use for sending the notifications. In this example that is the Case Assistent bot.

postas_pva02

7. Add a Add a new row action. Use the field you want from the body/data from the Post adaptive card and wait for a response action response.

addnewrow_notes01

8. In the Add a new row action relate the new row to the existing case.

addnewrow_notes02

9. Add a Update a row action. Update the existing case to the Statuscode In Progress.

updatecase_inprogress

Testing the result

1. Set the status of the case to Waiting for Details.

2. Respond to the adaptive card
notification_pva_test

3. This will be the card after you responded
notification_pva_test02

4. Navigate to the case. It should have a new note and the status should be In Progress.

notification_pva_test03

Happy testing!

You may also like...

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.