Buni.aiDocs
ChatbotUSSDAutomation

Collecting data

Collect validated answers from customers in a chatbot with the Form node, save them to a data store, and choose the right tool for USSD and the web.

In this guide you build a chatbot registration: the bot asks a few questions, checks each answer, shows a summary, and saves the result to a data store. At the end you will see how to collect the same data over USSD or on a web form.

Pick the tool by where your customers are:

Customers reach you onCollect withAnswers land in
WhatsApp, web chat, Telegram and other chat channelsForm node in a chatbotstate.<Answer set name>.<key>
A USSD short codeOne Menu per question, each with an Output variablestate.<Output variable>
A link, QR code or websiteForm Trigger in an automationstate.form.<key>

Before you start, you need a chatbot project connected to at least one channel, and a data store with fields for what you collect, for example name, phone, district and farmSize.

Add an intent that starts the form

Add an Intent node, connect the Trigger to it, set Intent Name to Register, and add utterances such as register, sign up and I want to join.

Add the Form node and its fields

Add a Form node after Register. On Basic Settings, set Form Name to Registration, and under Where the answers go set Answer set name to registration.

On the Fields tab, add one field per question:

Field KeyField TypePrompt
nameSingle-line textWhat is your full name?
districtDropdown / single choice, with your districts as optionsWhich district do you farm in?
farmSizeNumber, minimum 0.1How many hectares do you farm?

Each answer is checked against its type and limits before the next question. A wrong answer gets the reason and the question again.

On the Behavior tab, leave Confirmation on so the person reviews a summary before anything is saved. See Form for every field type and behaviour setting.

Save the answers

Connect the Form's submit handle to a Data Store node:

  1. Set Action to POST and choose your store under Data Store.
  2. Under Payload, map each field: name to {{state.registration.name}}, district to {{state.registration.district}}, farmSize to {{state.registration.farmSize}}, and phone to {{requestAttributes.id}} (the person's ID on the channel; on WhatsApp, their number).

To also keep the person in your contact list, add a Contact node after it.

Confirm and handle the other outcomes

  • After the Data Store node, add a Reply such as Thanks {{state.registration.name}}, you are registered.
  • Connect cancel to a Reply such as No problem. Send "register" any time to start again.
  • Connect failure, which is taken when a required question runs out of retries, to a Live Chat node or a Reply that explains how to get help.

Test

Open the simulator, send register, and answer the questions. Try a wrong answer (a letter for the farm size), back to change the previous answer, and cancel. Then publish.

Check that it worked

  • Each question is asked in order, and a wrong answer is rejected with a reason.
  • The summary lists all answers before saving.
  • A new record appears in your data store under Data Stores in the main menu.

Troubleshooting

Collecting over USSD

USSD has no Form node. Ask one question per Menu screen: set Menu Type to Intermediary, leave Menu Options empty so the caller can type an answer, and set Output variable to store it. Check each answer with a Router and its Fallback path, then save with a Data Store node set to POST. Keep it to a few short questions: the network ends idle sessions. See Menus and sessions.

Collecting on a web form

For people who are not chatting with you, use a hosted form. In an automation project, give the Trigger node the Form trigger type (or add a Form Trigger), add your fields, and share the Production URL after you publish. Each submission starts a run with the answers in {{state.form.key}}. The Form to WhatsApp message guide builds one end to end.

Next steps

Last reviewed 24 September 2026

On this page