Table of Contents

Ask a question block

Desirée M Updated by Desirée M

The Ask a question block asks visitors an open question and saves their typed answer in a Field. Use it when visitors need their own words, like a description, a model name or a reference number, and a set of Buttons can't cover the answer.

Ask a question panel saving the answer in the bike_problem Field, next to the flow whose message reuses bike_model and bike_problem

The Ask a question panel has three parts: Question text, the optional Settings, and Save user answer in the field.

How to add an Ask a question block

Add an Ask a question block from the output of the block that comes before it:

1️⃣ Drag from the block's output (the green arrow) to an empty spot on the canvas, or click the output.

2️⃣ Type Ask a question in Search by name.

3️⃣ Select Ask a question.

Animation of adding an Ask a question block from a block's output by searching for it in the block menu

The new block comes with a placeholder question, "Ask anything", and no Field, so it saves nothing until you change both. Connect it right after the Starting point if it's the first thing your agent asks.

The + button at the top left of the builder opens the same list of blocks.

How to write the question

Write the question in Question text: it's what visitors read right before they type their answer. Keep it to one clear question and say what a good answer looks like. "What bike are you bringing in? Brand and model is perfect." tells visitors exactly what to type.

To make the question personal, add a Field with Use field, such as the name the visitor gave earlier.

For emphasis or a link, use the toolbar. HTML tags typed into Question text, such as <b> or <a href="…">, also show formatted in the chat.

How to save the answer in a Field

Pick a Field in Save user answer in the field, or the answer is lost as soon as the visitor sends it. Until you do, the panel reminds you: "If a field is not set, the answer won't be saved."

● Reuse a Field you already have: click the box and choose it from the list.

● Create a new Field: type a name, such as bike_problem, and click Create new field.

Animation of the Save user answer in the field box listing existing Fields, then creating the new Field bike_problem

Once the answer is in a Field, the rest of the flow can use it: repeat it in a message with Use field, branch on it with a Conditions block, or send it to a spreadsheet. Fields explains everything else Fields can do.

In this example, a bike repair shop agent, Spoke & Sprocket, saves the bike in @bike_model and the problem in @bike_problem, then repeats both so the visitor can check them:

● Visitor's answers: Trek FX 2, then "The back brake squeaks when I stop. The chain also slips in the highest gears." on two lines.

● Agent's reply: "Thanks! 🔧 Drop off your Trek FX 2 any day from 9 to 6. Our mechanic will check this: The back brake squeaks when I stop. The chain also slips in the highest gears."

Chat where the agent's reply repeats the bike model and the two-line problem the visitor typed

Line breaks survive: a two-line answer prints on two lines.

What are the Ask a question block's settings?

The Ask a question block has five optional settings, shown when you turn on Settings: Size of text area, Min. characters, Max. characters, Regex pattern and Validation error message. They control how visitors type their answer and which answers the block accepts. With Settings off, the block takes any answer in a large text box.

Ask a question settings for a ticket number: Short text area, a regex pattern and a custom validation error message

In this example, the Spoke & Sprocket agent's ticket number question uses three of them: a Short text area, a Regex pattern that only accepts real ticket numbers, and a Validation error message that shows the right format.

How to choose the size of the text area

Choose Short for one-line answers and Long when you want visitors to explain something:

● Short: a one-line box. Visitors press Enter to send, and the chat reminds them with "Press enter to send".

● Long (the default): a bigger box where Enter starts a new line, so visitors click Send when they're done.

In this example, the Spoke & Sprocket agent uses both, one after the other:

● Short, "What bike are you bringing in? Brand and model is perfect.": the visitor types Trek FX 2 and presses Enter.

● Long, "Tell us what's going on with it: squeaks, wobbles, flat tires, anything you've noticed.": the visitor writes two lines and clicks Send.

Short text area in the chat with the answer Trek FX 2 typed and the hint Press enter to send
Long text area in the chat with a two-line answer about a squeaky brake and a slipping chain, and the Send button
Size of text area isn't available for WhatsApp or Facebook Messenger agents.
How to limit the answer length

Set Min. characters when very short answers aren't useful, and Max. characters when you need answers to stay brief. Left empty, they show 0 and 99999, so any length goes. An answer outside the limits isn't sent: the visitor sees the Validation error message and can try again.

In this example, the Spoke & Sprocket agent sets Min. characters to 20 on the bike problem question, because "It squeaks" doesn't tell the mechanic much:

● Shorter than 20 characters, It squeaks: "Could you tell us a bit more? A few words help our mechanic get the right parts ready." The answer isn't sent.

● 20 characters or more: the answer is sent and saved in @bike_problem.

Too-short answer "It squeaks" rejected with the message asking the visitor to tell a bit more
How to validate the answer with a regex

Add a Regex pattern when answers must follow a format, such as an order or ticket number. An answer that doesn't match isn't sent, and the visitor sees the Validation error message so they can fix it.

In this example, the Spoke & Sprocket agent only accepts ticket numbers made of SP and four digits, with the Regex pattern ^SP[0-9]{4}$:

● No match, sp-1234: "That doesn't look like a ticket number. It's SP followed by 4 numbers, for example SP1234."

● Match, SP1234: the answer is saved in @ticket_number, and the agent replies "Got it! 📦 We're checking repair SP1234. A mechanic will text you an update within the hour."

Ticket number sp-1234 rejected by the regex pattern with a message showing the right format

Regex examples has more patterns you can copy.

How to write the validation error message

Write a Validation error message that tells visitors what a good answer looks like. They see it under the box when their answer is too short, too long or doesn't match the Regex pattern, and by default it only says "I'm afraid I didn't understand, could you try again, please?".

A specific message saves visitors a guess: "It's SP followed by 4 numbers, for example SP1234." gets them to the right answer on the next try, while "I didn't understand" leaves them wondering what went wrong.

FAQs

Why isn't the visitor's answer being saved?

Because no Field is selected in Save user answer in the field. The Ask a question block saves the answer only into a Field, so pick an existing one or create a new one.

How can visitors send their answer by pressing Enter?

Set Size of text area to Short. With Long, Enter starts a new line and visitors click Send instead.

How do I change the text of the Send button?

Go to Settings > Custom System Messages > Buttons > Send button and type the new text.

How do I change the "Type here..." placeholder?

Go to Settings > Custom System Messages > Input texts > Free text placeholder and type the new text, for example to translate it. It changes the placeholder in every Ask a question block of the agent.

What happens when an answer is longer than Max. characters?

The answer can't be sent. Visitors can keep typing, but the box turns red and shows the Validation error message until the answer is short enough.

Can visitors skip an Ask a question block?

No. Send stays disabled while the box is empty, so visitors answer before the flow continues. With Min. characters at 0, an answer of only spaces does get through. To make a question optional, use the Forms block: its questions are optional unless you turn on Required.

Can I require a specific format, like an email or a number?

Yes. For emails, numbers and phone numbers, use the Ask for an email, Ask for a number and Ask for a phone blocks, which check those answers for you. For any other format, use Regex pattern with a Validation error message.

Was this article helpful?

Ask for an Email block

Ask for a Phone block

Contact