# Create or update a lead in a bot flow

> Add a step that fills in the customer's lead from their answers, or makes one, while the bot talks to them.

Source: https://docs.soosh.io/guides/chatbot/create-or-update-a-lead-in-a-bot-flow/

The **Create or update lead** step turns what a customer tells the bot into
their lead. A customer answers three questions about their budget, their city
and what they want, and by the end a lead is waiting for your team, filled in.

## Before you start

- [A plan that includes leads](https://docs.soosh.io/guides/leads/get-leads/)
- The **Create or update lead** step in the flow builder. If you don't see it, contact the Soosh team.
- A [bot flow](https://docs.soosh.io/guides/chatbot/build-a-bot-flow/) that asks the questions and saves the answers.
- A [pipeline](https://docs.soosh.io/guides/leads/add-a-pipeline/), and the [fields](https://docs.soosh.io/guides/leads/add-a-lead-field/) you want filled in.
- **View** under **Leads** or **Lead settings** in your role, so you can see the pipelines.

## Add the step

1. Go to [**Automation > Bot flows**](https://app.soosh.io/chatbot/flows) and open the flow.
2. Under **Add a step**, click **Create or update lead**. Put it after the
   steps that save the customer's answers.
3. In **Pipeline**, choose where the lead goes.
4. In **Stage**, choose where a new lead starts. **The first open stage** is
   the default. A lead that's already open moves to the stage you choose.
5. Optional: in **Title**, write one, like `Solar for {{contact_name}}`. Leave it
   empty to keep a lead's title. A new lead is titled with the customer's
   first name and the pipeline.
6. Optional: in **Value**, put an amount the customer wrote, like `1,20,000`.
   Use a saved answer's name in double braces, like `{{budget}}`.
7. Optional: under **Fields**, click **Add field**, choose a field, and in the
   box next to it enter what goes in it, like `{{city}}`. Repeat for each.
8. Click **Save**.

## Result

When a customer reaches the step, Soosh looks for their open lead in that
pipeline. If there is one, it fills it in. If not, it makes a new one, with the
source **Bot**. The flow always carries on to the next step.

- Answers that don't fit their field are left out. A flow can fill in up to 50 fields.
- Only open stages are offered, because a bot never marks a lead won or lost.
- A **Member** or **Product** field can't be filled by a customer's answer, so
  those aren't offered.
- If you archive the pipeline, stage or a field the step uses, Soosh tells you to fix the step when you save the flow.

In **Preview**, the step says the lead is filled in here in a real chat, and
a try doesn't change anything.

> **Note:** Ask the customer only what you need. Leads aren't the place for medical details, identity documents or bank details.

## Related

- [Build a bot flow](https://docs.soosh.io/guides/chatbot/build-a-bot-flow/)
- [Make leads automatically](https://docs.soosh.io/guides/leads/make-leads-automatically/)
- [How leads work](https://docs.soosh.io/concepts/how-leads-work/)
