Power Virtual Agents Chatbot Create Lead in Dynamics 365 for Sales (No Code)

In this topic we will leveraged Chatbot represent as sales person to simulate software selling scenario. Once get requirement from customer the Bot will trigger the flow to create record in Dynamics 365 Sales with Lead information.



There is 2 Part to achieve

Part1 : Create Power Virtual Agents Chat bot to capture requirement from Customer

Part2 : Create Microsoft Automate flow to Create Lead in Dynamics 365 Sales using Dataverse


Create Leads record in D365 Sales will use Dataverse Connectaion replace D365 connector (Deprecated)


Part1: Create Power Virtual Agents Chat bot to capture requirement from Customer

  1.1  Login to   Microsoft Power Apps    and select Environment. 

- Select Chatbot >> Crate






1.2 Power App will navigate to Power Virtual Agents >> New Topic

   


1.3  name the Topic and add phrases  to trigger the topic .for example phrases  is  "CRM" >> go to authoring canvas




1.4 Add multiple choices refer to available product.



1.4  the three conditional has been create as per each option








1.5 Create Question for E-mail



1.6 Drags three condition to one point before E-mail Step





1.7 Add another question.

-Person Name



-Budget Amount




Part2 : Create Microsoft Automate flow to Create Lead in Dynamics 365 Sales using Dataverse

2.1 add call an action step after "Processing your request" Message

2.2  System will navigate to Power Automate

- add Input to Power Virtual Agents step as follow


2.3 Add Microsoft Dataverse >>Add new Record


-  Select Entity "Leads" and assign variable from Power Virtual agents step.


2.4 add Last step return Value to Virtual agents then save


2.5 Back to Power Virtual agent and Map input variable to the flow. Save





2.5  Input variable for  Record created from Dynamics 365 Sales



Now time to test the Bot------------------------

- Test your bot and say Hi ,Standard topic (Greeting) are response    


- Input "CRM" , system detect Trigger Phrases and show the option


- After customer select product Bot will ask for more information



- The last question will trigger The flow to create Lead in Dynamics 365 Sales




- Open Dynamics 365 Sales Hub . Check Lead already create from Bot