# How to Use Spara's Text Editor

Spara's text editor appears wherever you write content that gets sent to leads — email bodies, SMS messages, workflow steps, and agent instructions. It includes formatting tools and a powerful Insert Menu for personalizing content with lead data.

## The Insert Menu (⚡)

The **bolt icon** (⚡) in any text field opens the Insert Menu. This menu lets you insert dynamic content at your cursor position without typing variable names manually.

The Insert Menu has up to three tabs depending on context:

### Variables

The Variables tab lists all available lead data fields, organized by category. Click any field to insert it as a variable. For example, clicking "First name" inserts `{{ first_name }}`.

Available categories include Lead Info, Account Info, Website Activity, Email Activity, Phone Activity, Meeting Activity, and more. For a complete list of all fields, see the [Data Model](/platform/data-model.md) documentation.

In workflows, the Variables tab also shows **Workflow Outputs** — data extracted by upstream API or Prompt steps. These are only visible in steps that come after the step that produces them.

### AI

The AI tab lets you insert AI-powered instructions into your content. This is used in email sequences to tell Spara's AI how to compose or customize parts of the message dynamically. Options include pre-defined behaviors from your agent configuration and a free-text field for custom instructions.

### Schedule Call

The Schedule Call tab lists your configured calendar links (Cal.com, Calendly, Chili Piper, etc.). Click one to insert a scheduling link that Spara renders as a calendar widget for the lead.

## Variable Syntax

Variables use double curly braces:

```
{{ variable_name }}
```

For example:

```
Hi {{ first_name }}, thank you for checking out {{ last_page_visited }}.
```

...becomes `Hi Sarah, thank you for checking out /pricing` when sent.

If a variable has no value for a lead, it renders as an empty string.

## Formatting

The text editor supports basic formatting via a floating toolbar that appears when you select text:

* **Bold** and *Italic*
* Ordered and unordered lists
* Hyperlinks

## Writing AI Instructions

Several places in Spara use a text editor for writing AI instructions — natural language prompts that tell your agents how to behave. These include:

* **Agent Editor** — The main prompt that defines your Chat, Email, Voice, or Text agent's personality, goals, and rules. See [AI Instructions](/agents/agent-overview/ai-instructions.md).
* **Workflow Prompt steps** — Custom AI instructions that run against lead data to classify, research, or extract information. See [Prompt Step](/agents/workflows/prompt.md).
* **Email sequences** — AI instructions embedded in email templates tell the agent how to personalize or vary the content.

When writing AI instructions, be specific and direct. For example, instead of "be helpful," write "Answer the lead's question using only information from the knowledge base. If you don't know the answer, offer to connect them with a sales rep."

## Where the Text Editor Appears

| Location              | What you're writing              | Insert Menu tabs available   |
| --------------------- | -------------------------------- | ---------------------------- |
| Workflow — Send Email | Email subject and body           | Variables                    |
| Workflow — Send Text  | SMS message body                 | Variables                    |
| Workflow — Notify     | Slack/Teams notification message | Variables                    |
| Workflow — API        | Request URL, headers, and body   | Variables                    |
| Workflow — Prompt     | AI instructions                  | Variables                    |
| Email sequences       | Email subject and body           | Variables, AI, Schedule Call |
| Agent Editor          | Agent behavior instructions      | N/A (plain text)             |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.spara.com/guides/platform-guides/how-to-use-sparas-text-editor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
