Using and sanitizing forms in conversation flows for advanced AI agents with Sunshine Conversations

What's my plan?

Add-on | AI agents - Advanced

Form messages are a type of structured message from Sunshine Conversations that allow you to capture user data in an ongoing conversation by displaying a form that can contain text inputs as well as select dropdowns.

Before you start

Before integrating a form into AI agents - Advanced, though, you will need to create your form on Sunshine Conversations side. You can find information here on how to do this. Contact your CSM if you have any questions about this.

You will need the exact name of the form later on.

In this article we will cover:

Using Forms with AI agents - Advanced

Sanitize Customer Responses

How to Sanitize Form Data

Using Forms with AI agent - Advanced

Forms are a great way to collect customer data without having the AI agent ask multiple questions. Typical use cases include security, identification questions, or data change requests.

Once your form is created, go to your respective Dialogue that you would like to add the form and follow the below steps.

Steps:

Add an AI agent message with the shorthand code to capture the form and insert it. In the picture below we are adding our lead_capture form. However, you will add the name of your form in between template: and ))% in the snippet below.

%((template: nameOfTemplate))%

Add a customer message (Free Text Written) block right after the AI agent message. This captures the user's responses.

Add another AI agent message block following the customer message with some kind of acknowledgment of the customers' completion of the form, such as a thank you.

The user's answers are locked in the metadata. If you want to use them later in the chat, you will want to retrieve them - this is completely optional. We do this with Actions.

Add the Get Conversation action, select <Metadata>, and complete the fields to save the answers from customers to the session. In the Metadata Key, use the form fields name, as configured in your Sunshine Conversations template. Learn more about Sunshine Conversation Actions.

Sanitize Customer Responses

Sanitizing responses is something you will want to do if you are asking for any PII data from your customers. This is something you will be familiar with from entities, for example, we by default sanitize email addresses and IBAN numbers. To understand more about Sanitizing check out the below articles.

AI agents - Advanced data processing explained

Recipe: Sanitize Personal Identifiable Information (PII) data with entities

How to sanitize form data

Depending on the use case you have for the forms, you may want to sanitize the information. This is easy to do.

Click the blue bar where it says "if..." to open the details panel.

Click the "Sanitize the user's answer" box to have the details hidden within AI agents - Advanced.

The result of this means that when you review the conversation within AI agents - Advanced, it will look as shown below.