# Collect custom details from customers in chat > Have your AI agent gather the details you choose, in the conversation or with a form widget The **Collect data** Action lets your QwryAI agent gather the details you choose, such as a shipping address, an order number or feedback, from the customer during a conversation. You list the details as data inputs, and the agent asks for them in the chat, or shows a form widget the customer fills in. Every submission is saved under **Activity › Collected data**, and you can send it to a webhook or an inbox. **Best for:** collecting structured details, such as a shipping address, feedback or an application, without sending the customer to a separate page. **Common use cases:** * Collecting a new shipping address before you change a delivery * Gathering feedback details after a support conversation * Capturing the specifics of a request your team will act on later > [!TIP] > > You can add more than one Collect data Action to the same agent, each with its own name, data inputs and destinations. For example, one Action for a shipping address and another for feedback. ## How to create the Action **1. Open Actions** In your [QwryAI dashboard](https://www.qwryai.com), select your agent and click **Build › Actions** in the sidebar. **2. Create the Action** Click **Create Action**, then the **Collect data** card ("Collect custom data from your users during the conversation"), then **Start customizing**. **3. Configure General** **Action name:** a descriptive name for this Action. It starts as `collect_data`. Use one that says what's collected, such as `collect_shipping_details`. Names can contain only letters, numbers, underscores and hyphens, with no spaces, and must differ from your other Actions' names. ![collect_shipping_details typed in Action name.](annotated/01-name.webp "Name the Action after the data it collects.") **When to use:** when the agent should collect this data. Say what's collected and why, and add example customer questions. ![When to use filled in: collect the shipping address when the customer wants to change a delivery address.](annotated/02-when.webp "Describe when to collect the data.") To run the Action only as a [Procedure](/docs/user-guides/chatbot/procedures/procedures-overview) step, turn on [**Only use in Procedures**](/docs/user-guides/chatbot/actions/actions-overview#only-use-in-procedures). **When to use** is then hidden. Click **Continue** to save the section. **4. Add your fields** In **Fields**, choose how the data is collected and list what to collect. See [Fields](#fields). **5. Set your destinations** In **Destinations**, choose where each submission is sent, or click **Skip**. See [Destinations](#destinations). **6. Choose Channels** Collect data works on every channel except phone. Turn it on or off for each configured channel. See [Channels](/docs/user-guides/chatbot/actions/actions-overview#channels). **7. Enable and test** Click **Enable**. The header shows an **Enabled** switch, and the Action is live straight away. Then test it in the **Preview** on the right. ## Fields The **Fields** section starts with **How should data be collected?**: | Option | What the customer sees | | - | - | | **Conversation** | The agent asks for each detail in the conversation. | | **Widget** | Customers fill in a form widget and submit it. | This applies to the Chat bubble and the Help page. Other channels, like WhatsApp and Instagram, always collect data conversationally. New Actions start on **Conversation**. ![The Fields section with How should data be collected?, the Conversation and Widget options, and an empty Data to collect table with Add data input.](annotated/03-fields.webp "Fields: how and what to collect.") ### Data to collect With **Conversation**, list the information the agent should collect from the customer. Click **Add data input** for each one: | Column | What it sets | | - | - | | **Name** | The detail's name, such as `street_address` | | **Type** | **text**, **number**, **email**, **date** or **boolean** | | **Description** | What the agent should ask for | | **Required** | When on, the agent always asks for it before saving. When off, it's saved only if the customer shares it. | An Action holds up to 20 data inputs. Each needs a name and a description, and names must be unique. ![Two data inputs: street_address and postcode, each of type text with a description and Required ticked.](annotated/05-add-input.webp "Add data input adds a row: name, type, description, required.") ### Widget With **Widget**, add a form widget from **Build › Widgets**, or create one. **Data to collect** then lists the widget's inputs with their types and whether they're required; edit the widget to change them. See [Widgets](/docs/developer-guides/widgets/overview). ![Widget selected under How should data be collected?, with a button to add a form widget.](annotated/04-widget.webp "Widget mode uses a form widget.") ### What the customer sees In the conversation, the agent asks for each detail and asks again for anything required that's still missing. It saves the submission once it has what it needs, then writes its own reply. > [!TIP] > > To get a specific confirmation, say so in **When to use**, for example "After saving, read the address back to the customer." ### Collected data Submissions appear under **Activity › Collected data**, with the Action that collected them and a column for each detail. ### Example: a new shipping address An Action named `collect_shipping_details` with two required data inputs, `street_address` and `postcode`, set to **Conversation**, with **When to use** set to "Use this Action when the customer wants to change the delivery address of an order or asks us to resend a parcel." | Who | Message | | - | - | | **Customer** | Hi, I moved house last week. Can you change the delivery address for order #1042? | | **Agent** | Of course. What's the new street address and postcode? | | **Customer** | Sure, it's 4/12 Harbour Street, Pyrmont NSW 2009. | | **Agent** | Thanks, I've saved your new address for order #1042. | ## Destinations Use **Destinations** to choose where each submission goes. Click **Skip** if you don't want to send it anywhere. ![The Destinations section with Webhooks and Email notification, and Skip and Continue buttons.](annotated/06-destinations.webp "Destinations: where submissions go.") ### Webhooks Add one or more endpoints that receive each submission. **1. Open Destinations** Expand the **Destinations** section of the Action. **2. Enter the endpoint URL** Type the URL in the webhook box, for example `https://mywebsite.com/webhooks`. It must start with `https://`. **3. Create the webhook** Click **Create webhook**. ### Email notification Turn on **Email notification** to get an email every time data is collected through this Action. Add up to 10 recipients. ## Channels Collect data works on every channel except phone. Use **Channels** to turn it on or off for each one. ![The Channels section with Configured channels and their switches.](annotated/07-channels.webp "Channels for Collect data.") ## Limitations * **Up to 20 data inputs per Action.** For more, split the collection across separate Collect data Actions. * **Five input types in Conversation mode.** Text, number, email, date and boolean. For choices or other inputs, use **Widget** mode with a form widget. * **The form widget shows on the Chat bubble and the Help page only.** Other channels collect the same details in the conversation. * **Not available on phone.** ## Best practices > [card] One Action per purpose | /docs/user-guides/chatbot/actions/actions-overview | Create separate Actions, such as collect_shipping_details and collect_feedback, each with its own fields and destinations. > [card] Describe every input | /docs/user-guides/chatbot/actions/collect-data | The description is how the agent knows what to ask for. Say what format you expect. > [card] Require only what you need | /docs/user-guides/chatbot/actions/collect-leads | Every required input is another question before the agent can save. > [card] Send it where your team works | /docs/developer-guides/webhooks | Use a webhook or an email notification so submissions reach the right people. ## Frequently asked questions > [accordion] How is Collect data different from Collect leads? > > [Collect leads](/docs/user-guides/chatbot/actions/collect-leads) captures a contact's name, email and phone number as a lead, saved under **Activity › Leads**, and each agent has one. Collect data collects any details you choose, saved under **Activity › Collected data**, and you can add several. > [accordion] Can a data input be a dropdown or multiple choice? > > Not in **Conversation** mode: types are text, number, email, date and boolean. List the allowed values in the description, for example "One of: Standard, Express." For real choices, use **Widget** mode with a form widget. > [accordion] What happens if the customer doesn't give a required detail? > > The agent asks again. A submission is saved only once every required detail is collected. > [accordion] Can I collect data on WhatsApp or email? > > Yes. Collect data works on every channel except phone. Channels other than the Chat bubble and Help page always collect conversationally. > [accordion] Why can't I save the Fields section? > > Every data input needs a name and a description, names must be unique, and some names are reserved. The message under the table says which rule failed. ## Next steps > [card] Collect leads | /docs/user-guides/chatbot/actions/collect-leads | Capture contact details as leads. > [card] Widgets | /docs/developer-guides/widgets/overview | Build a form widget for Widget mode. > [card] Procedures | /docs/user-guides/chatbot/procedures/procedures-overview | Collect data as a step in a flow. > [card] Webhooks | /docs/developer-guides/webhooks | Receive submissions in your own systems. > [card] Actions overview | /docs/user-guides/chatbot/actions/actions-overview | See every Action you can add.