> ## Documentation Index
> Fetch the complete documentation index at: https://docs.get2dial.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an agent script

> Write a talk-track with lead-data placeholders that fill in automatically, and attach it to a campaign.

Write a script agents see during a call, with placeholders that fill in from the lead they're
talking to.

## Before you start

* You need an **admin** role.

## Steps

<Steps>
  <Step title="Go to Scripts">
    In the left navigation, select **Scripts**, then **New script**.
  </Step>

  <Step title="Name it and write the text">
    Enter a **Name** and write the script body. Turn on **Markdown** if you want headings,
    bold, or lists to render formatted rather than as plain text.
  </Step>

  <Step title="Add placeholders for lead data">
    Insert a placeholder using the lead's field name in curly braces, for example
    `{first_name}` or `{timezone}`. Any [attribute](/outbound/leads/lead-fields) the lead
    carries is available this way, including columns from your CSV import that weren't mapped
    to a specific field.
  </Step>

  <Step title="Preview it">
    Use the preview pane to see the script rendered with a sample lead's data substituted in.
  </Step>

  <Step title="Save">
    Select **Save**.
  </Step>

  <Step title="Attach it to a campaign">
    In the campaign's settings, set **Script** to the one you created — see [Campaign settings
    reference](/outbound/campaigns/campaign-settings).
  </Step>
</Steps>

## Verify

<Check>
  An agent on a call in that campaign sees the script, with every placeholder replaced by that
  lead's actual data — see [Use a script during a call](/agent/use-a-script).
</Check>

## Common problems

* **A placeholder shows up literally instead of being replaced.** Confirm the field name
  inside the braces matches the lead's attribute name exactly, including case.
* **Formatting doesn't render.** Confirm **Markdown** is turned on for this script.

## Next steps

<CardGroup cols={2}>
  <Card title="Create a campaign" href="/outbound/campaigns/create-a-campaign" />

  <Card title="Lead fields" href="/outbound/leads/lead-fields" />
</CardGroup>
