Use a Chatbot To Generate Documents and E-Sign
Learn how to create a basic chatbot by using Adobe Document Generation and Adobe Sign with Microsoft Power Virtual Agents.
Join the DZone community and get the full member experience.
Join For FreeVery recently, I was taking a flight and had to change my flight to the following day. Instead of jumping onto a phone call, I was able to work with a chatbot to reschedule. The bot was able to look up my information and saved me a lot of time, and saved me the hassle of listening to muzak waiting on hold.
These days, chatbots are all over the place. They are on websites, built into apps, and even built into intranets and communication tools like Microsoft Teams. According to IBM, chatbots can reduce customer service costs by 30% because they save on expensive call center calls, get answers more quickly for users who prefer to text rather than talk, and give you much more reliable data to improve customer experiences.
I don’t know how often my customer interaction has basically been verbally giving my information so someone else could key it into a computer to fill out a form or input data into a CRM, or generate all of the paperwork needed for me. It would be really great if a customer could answer questions in a chatbot. It can automatically fill out any of the necessary paperwork and even present the signature for me.
In this article, we’ll learn how you can:
- How to create a basic chatbot using Microsoft Power Virtual Agents
- Populate and generate documents using Adobe Document Generation in Microsoft Power Automate
- Present a document for signature using Adobe Sign from the chatbot
For this article, we aren’t going to focus on the tagging of the document and use this document for our example. If you haven’t already, you can sign-up for a free trial of Adobe PDF Services to be able to generate documents and use PDF actions inside of Microsoft Power Automate.
What You Are Going To Need
To get started on this, you are going to need the following:
- Subscription to Microsoft Power Virtual Agents (there are free trials for Microsoft 365 customers).
- Adobe PDF Services to dynamically generate documents and populate forms from Word documents.
- Adobe Sign to present documents for signature
This article also does assume some working knowledge of tools like Microsoft Power Automate, Adobe Sign, and Adobe Document Generation. We will also provide some helpful links throughout the article if you are new to many of these areas.
Scenario
For this scenario, we will create a basic chatbot that helps fill out a service order for some home services such as cleaning services, carpet cleaning, etc. We will use Microsoft Power Virtual Agents for the chatbot, generate our document using Adobe Document Generation, Microsoft Power Automate for creating our logic, and Adobe Sign to capture the signature on the service order.
There is a lot of logic to incorporate and different threads to the conversation we could configure. You could have the data from the chatbot create leads in Microsoft Dynamics or SalesForce, and you could trigger follow-up emails, etc. We will keep it simple to show you how Adobe PDF Services and Adobe Sign can work with a virtual agent.
You can certainly do the same using Microsoft Bot Framework, Logic Apps, or even using Adobe Sign and PDF Services using our APIs for more advanced users.
Create Sales Order Template
For this scenario, we are creating a Word template for our sales order. We are using the following JSON example:
{
"customer": {
"@context": "https://schema.org",
"@type": "Person",
"address": {
"@type": "PostalAddress",
"addressLocality": "Seattle",
"addressRegion": "WA",
"postalCode": "98052",
"streetAddress": "20341 Whitworth Institute 405 N. Whitworth"
},
"email": "mailto:jane-doe@xyz.edu",
"jobTitle": "Professor",
"name": "Jane Doe",
"telephone": "(425) 123-4567",
"url": "http://www.janedoe.com"
},
"tax": {
"state":"WA",
"rate": 0.08
},
"referencesOrder": [
{
"description": "Carpet Cleaning Service - 3BR 2BA",
"totalPaymentDue": {
"price": 359.54
},
"orderedItem": {
"@type": "Service",
"description": "Carpet Cleaning Service"
}
},
{
"description": "Home Cleaning Service - 3BR 2BA",
"totalPaymentDue": {
"price": 299.99
},
"orderedItem": {
"@type": "Service",
"description": "House Cleaning Service"
}
}
]
}
Understand the JSON Data
This JSON schema above is based on the invoice schema from Schema.org. Let’s understand the data structure a little better.
You will see the referencesOrder
array in the schema, which lists each item listed in the invoice.
The customer
object is used to populate the customer information.
Create Your Template
Use this template for this example. Save it into SharePoint or OneDrive to be easily referenced in Microsoft Power Automate when creating our documents.
To explain a little more how this template works, see the diagram above.
- The customer information is populated using the tokens that look like
{{customer.name}}
and other tags and follow the JSON data structure. - Iterate through each item in the
referencesOrder
array and place in the appropriate field. - There are sum calculations that calculate the sum of each of the
referencesOrder
items and uses the$formatNumber()
function to format them into currency. If you want to learn more about using the$formatNumber
and other functions, see this article here.
Now that we have this file stored in Microsoft SharePoint or OneDrive (we will show SharePoint), we can get started creating a virtual agent.
Create Your Virtual Agent to Collect Information
Creating a virtual agent using Microsoft Power Virtual Agents is super-easy and doesn’t require a single line of code.
Create Your Virtual Agent
- Log into Microsoft Power Virtual Agent.
- In the sidebar, click on Topics.
- Click on New topic.
- Set your Name (ex. Request Services).
- Enter a Trigger Phrase. (ex. I want to order cleaning services).
It is good to add multiple trigger phrases to learn and understand the types of phrases to begin the conversation. It is good to have 5–10 examples. Some examples include:
- I want cleaning services.
- I want someone to clean my house.
- I need a carpet cleaner.
Once you are done, click on Go to authoring canvas. This might take a moment for Power Virtual Agent to create a new topic.
Here is the overall topic that we are going to create:
As you can see, it is essentially doing the following:
- Prompt to get information about the customer (name, address, email, phone)
- Prompt to determine whether they want cleaning and/or carpet cleaning services
- Trigger Microsoft Power Automate to generate documents and send them for signature using Adobe Sign
Let’s break down a few of the ways that you can do this.
To create a question prompt:
- In the Authoring canvas, click the + sign to add a new action.
- Click Ask a question.
- Enter in your question.
- Under Identify, select the type of response you are looking for. This allows it to format and ask questions appropriately. For example, Boolean will ask the person Yes or No.
- Under Save Response As, you will see a variable. Click on the pencil edit button to edit the variable.
- Give the variable a name. Ex. Name.
That’s all you need to do to create questions. You can add all of the questions we asked in the screenshot above. You can also create conditions which you can learn more about here.
Published at DZone with permission of Ben Vanderberg. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments