# Configure Questionnaires

Set up Pre-Chat and Post-Chat questionnaires in just a few steps:

### STEP 1: ENABLE QUESTIONNAIRE TOGGLES

1\.       Open T**extSMS4Dynamics**.

2\.       Navigate to **Configurations** > **Questionnaire**.

3\.       Enable the following:

* Pre-Chat Questionnaire – Starts when the customer sends the first message.
* Post-Chat Questionnaire – Triggers either during the chat or automatically after the agent ends it.

4\.       Choose Trigger Frequency:

* **Once** – Sent once per customer.
* **Every** – Triggers with every new session.

5\.       Click **Save**.

<figure><img src="/files/ZXkQVAhmkX6ZeXNCmrJG" alt=""><figcaption></figcaption></figure>

### STEP 2: CREATE A QUESTIONNAIRE RECORD

1. Go to **Questionnaires**, click **New Questionnaire**.

<figure><img src="/files/nrAwQdtJm7HVXaZ1xk5S" alt=""><figcaption></figcaption></figure>

2. Fill in:

* **Name** – e.g., “Pre-Chat – Support Inquiry”
* **Type** – Pre-Chat or Post-Chat
* **Default Create Record** – This field is used to define a default customer record type that will be automatically created if no existing customer matches the selected identifier fields from all the created record types. It displays a list of available record types related to the configuration. If the system cannot find a match from the listed customer identifiers, it will automatically create a new record using the selected record type from this field and link it to the chat conversation. This ensures that every chat is associated with a valid customer record in Dynamics 365 CRM, helping maintain clean and complete data.
* **Default Questionnaire** – Mark as default (only one default per type)

<figure><img src="/files/gbvPB8MmKxVSaC0ei25u" alt=""><figcaption></figcaption></figure>

3\.       Click **Save**.

### STEP 3: CREATE QUESTIONNAIRE MESSAGE TEMPLATES (QUESTIONS)

Each question is based on a text SMS message template and is linked to the questionnaire you created.

How to Create a Pre-Chat Template:

1. Go to the **Message Templates** tab.
2. Click **New Message Template**.

<figure><img src="/files/cfOEIiYQSqIQ0qEhkLal" alt=""><figcaption></figcaption></figure>

3\.       Fill in the following:

* Template Type – Auto-set to Pre-Chat or Post-Chat depending on the parent questionnaire.
* Question Data Type – Choose the data type for the question
* Template – Choose an existing TextSMS/Twilio template.
* Title – e.g., **“InquiryType”**
* Questionnaire – Auto-linked to the selected questionnaire.
* Click **Save & Publish**

#### **Choose Question Data Type**

Pick the type of input you want for the question:

* Single Line Text – Used to enter short pieces of text like names, emails, or titles. Example: Name: John Doe Email: <john@example.com>.
* Whole Number – Used for number-only inputs with no decimals. Best for things like age. Example: Age: 30.
* If the user selects either the Single Line Text or Whole Number, the corresponding Map Response In field will be auto-populated on the form.

<figure><img src="/files/F1CteDpw02nGlPwcEGB4" alt=""><figcaption></figcaption></figure>

**Map Response** – Link the user's reply to a CRM field (e.g., Contact. Phone or Lead.ProductInterest) If the default create record is set for the questionnaire, then, when a new record is created, the response is auto-filled in this field.

* For example, if the user selects the **"Contact"** entity under the Default Create Record Field and chooses either **"Single Line Text"** or **"Whole Number"** for the Question Data Type, a list of fields from the Contact entity will be displayed.
* The user can then select the desired field based on which the record should be created.

<figure><img src="/files/9BRA9nqncNmuKAqCEJWG" alt=""><figcaption></figcaption></figure>

* Click **Save**.

#### How to Create a Post-Chat Questionnaire

1\.     In the **Questionnaire** Settings section, click **New Questionnaire** under the subgrid.

2\.     Enter a clear and meaningful name for your form, such as ***Feedback Form*****.**

3\.     (Optional) Select Set as Default to make this the default questionnaire.

4\.     Click **New Message Template** under the same section.

<figure><img src="/files/VBT52t7XBmia2shyY93R" alt=""><figcaption></figcaption></figure>

5\.     Fill:

* Template Type – Select "Post-Chat
* "Template Name
* Title – e.g., “Service Feedback”

<figure><img src="/files/O5tXtiF9r3SDDsUUSQLb" alt=""><figcaption></figcaption></figure>

6\.       Click Save & Publish.

#### End-to-End Chat Flow Example:

Customer sends a message → Triggers **Pre-Chat Questionnaire**.

* Questions are sent in sequence using TextSMS/Twilio templates.

<figure><img src="/files/oG8iVtnq8cQFd820ZCp0" alt=""><figcaption></figcaption></figure>

* Chat status is Bot Conversation until all pre-chat questions are answered.
* &#x20;Once all the questions are answered, the chat status changes to “waiting for agent,” which gets notified on the side panel, from where the CRM agent accepts the chat and continues the conversation.
* When the agent clicks “End Chat”, the Post-Chat Template is automatically sent.

<figure><img src="/files/BQunkgrHluPc9q8xFdox" alt=""><figcaption></figcaption></figure>

* On clicking “End Chat,” if the Post-Chat Questionnaire toggle is enabled, the configured Post-Chat Template is automatically sent to the customer.

**This is how the Post-Chat response appears in the agent's view:**

* The agent can see the feedback template that was sent.

<figure><img src="/files/9IiHJgsh7RNUZdHBdxLk" alt=""><figcaption></figcaption></figure>

&#x20;

&#x20;

&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.inogic.com/textsms4dynamics/configuration/configure-questionnaires.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
