Skip to main content

Use AI variables in lemlist

Use AI to clean and personalize lead data at scale

Learning Objective

By the end of this guide, you'll know how to create AI Variables from your lead list, configure AI settings for different use cases, generate personalized content at scale, and troubleshoot common issues. You'll be able to clean messy data, write tailored messages, and segment thousands of leads in seconds using AI-powered prompts.


Why This Matters

Raw lead data rarely arrives campaign-ready. Job titles have emojis, company names are inconsistent, and personalization fields need context-aware content. AI Variables automate this cleanup and personalization work that would otherwise take hours.

With AI Variables, you can:

  • Clean 1,000+ leads in under a minute instead of manual editing

  • Generate personalized intro lines that increase reply rates

  • Standardize inconsistent data such as job titles and company names for better segmentation

  • Write contextual messages based on lead information without copying and pasting

AI Variables turn messy, generic data into clean, personalized content that drives authentic conversations and higher engagement.


Prerequisites

Before you start, make sure you have:

  • lemlist credits available or access to a supported AI provider in the AI Variable settings

  • A campaign with leads imported that includes the variables you want to transform or use in prompts

  • Basic understanding of custom variables and how they work in lemlist sequences


Core Lesson: Step-by-Step Workflow

Phase 1: Access AI Variables

Step 1: Open your campaign's Lead list and create an AI column

In your campaign, open the Lead list tab, then click + Add and select Create AI column. This opens the AI Variable setup flow from your leads table.

Open the Lead list and create an AI column

Phase 2: Create Your First AI Variable

Step 2: Choose your starting point

In AI Column Templates, browse the template categories in the left panel to find a single AI column template for cleaning, copywriting, extraction, research, or segmentation.

Browse AI column template categories

If you want a multi-step setup that creates several AI columns together, switch to the AI Columns Workflow tab and choose a workflow from the list.

Browse AI Columns Workflow templates

You can also skip templates and click Create from scratch to write your own prompt from the ground up. When using a workflow or template, review any required input columns before proceeding.

Create an AI variable from scratch

Step 3: Name or select your AI variable

In the Create AI variable panel, use Select AI variable to choose the variable you're configuring, or enter a new name if you're creating one from scratch.

Naming examples:

  • personalizedOpener for intro lines

  • industryCategory for segmentation

  • companyNameCleaned for standardized names

💡 Tip: Use camelCase or underscores for multi-word variable names to keep them clean and readable.

Select or name your AI variable

Step 4: Configure AI settings

Set your AI preferences based on your use case:

AI Provider: Choose the model provider you want to use for generation. Available options include lemlist, OpenAI (GPT), Perplexity, Claude, and Google.

Choose an AI provider

Temperature setting: Adjust the slider to control how consistent or creative the output should be.

Adjust temperature for AI output
  • 0 to 0.3 – Focused, consistent output for cleaning and standardization

  • 0.4 to 0.6 – Balanced creativity and consistency

  • 0.7 to 1.0 – More creative output for personalized writing

Optional tools: Enable extra tools if your use case needs them.

Activate optional AI tools

Credit source: In Advanced settings, review the Consumption mode and per-request cost before generating.

Review consumption mode and cost

Phase 3: Write and Test Your Prompt

Step 5: Write your AI prompt

If you selected a template, review and customize the prompt to fit your needs. If you're creating from scratch, write clear, specific instructions for what the AI should generate in the Prompt field.

Edit the AI prompt

Good prompt structure:

  1. What to do: "Remove emojis and abbreviations from job titles"

  2. Format: "Output only the cleaned title, no extra text"

  3. Example: "Input: 'CEO 🚀' → Output: 'CEO'"

Example prompts:

Data cleaning:

Remove all emojis, special characters, and abbreviations from {{jobTitle}}. Return only the standardized job title. Example: "VP of Mktg 🚀" becomes "Vice President of Marketing"

Personalized opener:

Write a one-sentence personalized opener for an outreach email based on this information: {{companyName}} in {{industry}}. Keep it under 20 words, conversational tone, and mention their industry or company focus.

Categorization:

Based on {{companyName}}, determine the industry category. Choose from: SaaS, E-commerce, Finance, Healthcare, Marketing Agency, Other. Return only the category name.

💡 Pro tip: Include examples in your prompt. AI performs better when it sees the expected input-output format.

You can optionally click the + button to add extra knowledge and capabilities, enable AI company context, or allow web search if your prompt needs more context.

Add knowledge and capabilities to the prompt
Enable AI company context
Enable web search for the AI prompt

Step 6: Test your prompt

Before generating for the whole list, click Test prompt to preview the output on a sample lead.

Test the AI prompt

Step 7: Enable auto-generation for new leads if needed

If you want future imports to be processed automatically, turn on Auto run on new leads.

Enable auto run on new leads

Step 8: Generate AI variables

Once your prompt is ready, click Generate AI column, then choose:

  • Generate all rows: Runs AI on every lead, overwriting any existing data in that column

  • Generate empty rows only: Runs AI only on leads where the variable is currently empty, preserving existing data

💡 When to use each:

  • All rows: When you've updated your prompt and want fresh results for everyone

  • Empty rows only: When adding new leads to an existing campaign with AI Variables already set up

Generate all rows or only empty rows

The AI processes your leads based on your prompt. Depending on lead count and provider, this typically takes a few seconds to a minute.


Phase 4: Review and Refine Results

Step 9: Check the generated output

Once generation completes, review the AI Variable column in your Lead list. A successful output appears directly in the row, while rows with issues may show Empty output warnings.

Review generated AI outputs and empty output warnings

Check for:

  • Accuracy: Does the output match what you expected?

  • Consistency: Is the format uniform across leads?

  • Quality: Would this content work in your sequence?

Step 10: Regenerate if needed

If the output isn't quite right:

  1. Open the AI variable settings again from the lead list

  2. Adjust your prompt, AI provider, or temperature

  3. Run the generation again for all rows or empty rows only

You can iterate as many times as needed to get the right output.

💡 Refinement tip: If the output is too generic, lower the temperature and add more specific instructions. If it's too rigid, raise the temperature slightly.


Phase 5: Use AI Variables in Your Sequence

Step 11: Insert the variable into your email

Open the Sequence tab in your campaign.

Then open the email step where you want to use your AI Variable, click Add personalization, and select the AI Variable you want to insert from the personalization picker.

The AI-generated content will automatically populate for each lead when the email is sent.


Editing Existing AI Variables

  1. Open your campaign and go to the Lead list.

  2. Click the AI variable column or one of its generated values to reopen the Create AI variable panel.

  3. Update the prompt, AI provider, temperature, tools, or advanced settings as needed.

  4. Test the prompt again if needed, then regenerate results for all rows or only empty rows.

💡 Time-saver: If you're continuously importing leads, enable Auto run on new leads so new rows are generated automatically.


Practical Application / Real-Life Example

SaaS Company Scenario: Cleaning and Personalizing at Scale

A B2B SaaS company targeting sales leaders had thousands of leads with messy job title data:

  • "VP of Sales 🚀"

  • "Head of Rev Ops (RevOps)"

  • "CRO | Chief Revenue Officer"

  • "Sales Dir."

Their workflow:

Step 1: Created an AI Variable cleanedJobTitle with this prompt:

Remove emojis, special characters, abbreviations, and parenthetical text from {{jobTitle}}. Expand abbreviations to full titles. Return only the clean title. Examples: "VP of Sales 🚀" → "Vice President of Sales", "Sales Dir." → "Sales Director"

Step 2: Set the temperature to 0.2 and chose a structured model for consistent output

Step 3: Generated for all leads

Step 4: Created a second AI Variable personalizedOpener with this prompt:

Write a one-sentence opener for a cold email to a {{cleanedJobTitle}} at {{companyName}}. Refer to their role's main challenge. Keep it under 15 words and conversational.

Step 5: Increased the temperature for more creative output

Step 6: Generated personalized openers for all leads

Results:

  • Data cleanup: Job titles standardized in under a minute

  • Personalization: Unique intro lines generated at scale

  • Time saved: Hours of manual work automated

Key takeaway: AI Variables transform unusable, messy data into clean, personalized content with only a few minutes of setup.


When a Template Relies on a Missing Variable

If you choose a template that requires a variable that doesn't exist in your lead data, a yellow banner appears in the AI Variable panel.

The banner shows which variable is missing, so you can update your lead data or adjust the prompt.

Fix:

  • Add the missing variable by importing a CSV with that column

  • Or create/populate that variable in your Lead list first

  • Then regenerate the AI Variable

The AI cannot generate output until all required input variables exist.


Troubleshooting & Pitfalls

Issue: The AI variable column is empty after generation

Root cause: The prompt may be unclear, the required input data is missing, or the AI couldn't interpret the instructions

Fix:

  • Check that the variable your prompt references (for example, {{jobTitle}}) exists and contains data

  • Make your prompt more specific with examples of expected output

  • Lower the temperature to 0.2-0.3 for more consistent results

  • Use Test prompt before generating for your full lead list

Issue: The AI output doesn't match what I expected

Root cause: Prompt lacks specificity, temperature is too high or too low, or examples are missing

Fix:

  • Rewrite your prompt with explicit instructions and 2-3 input → output examples

  • Adjust temperature:

    • Too generic or robotic? Raise temperature to 0.6-0.8

    • Too random or inconsistent? Lower temperature to 0.2-0.4

  • Specify the exact format you want, such as "Return only the category name"

Issue: Yellow banner says a variable is missing

Root cause: The template requires a variable that isn't in your lead data

Fix:

  • Check which variable is missing in the banner message

  • Add that variable by importing it or filling it in on the Lead list

  • Regenerate the AI Variable after the variable exists

Issue: AI generation is taking too long or timing out

Root cause: Large lead list, complex prompt, or provider-side delays

Fix:

  • Generate in smaller batches instead of all at once

  • Simplify your prompt

  • Try a different AI provider

  • Wait a few minutes and try again if the provider is experiencing high traffic


Optimization Tips

To maximize AI Variables' effectiveness:

Start with templates, then customize: Templates give you proven prompt structures. Once you understand how they work, adapt them to your needs or create from scratch.

Use temperature strategically:

  • Data cleaning and categorization: 0.2-0.3

  • Writing subject lines or openers: 0.6-0.8

  • Professional formal content: 0.3-0.5

Test small before scaling: Review the output, refine your prompt, then generate for all leads once you're satisfied.

Include examples in your prompts: AI performs significantly better when you show input → output examples.

Chain AI Variables: Create one AI Variable to clean data, then create a second AI Variable that uses the first one as input.

Monitor credit usage: Check the Consumption mode and cost in Advanced settings before running large generations.

Regenerate after data updates: If you enrich leads with new information, regenerate AI Variables to incorporate the fresh data.

Enable auto-generation: For campaigns where you continuously add leads, enable Auto run on new leads.

Use specific providers for specific tasks:

  • OpenAI (GPT): Data cleaning, categorization, structured output

  • Claude: Nuanced writing and longer-form personalization

  • Perplexity: Research-based content

  • Google: Alternative option for general tasks

  • lemlist: Native built-in option


What You Cannot Do with AI Variables

AI Variables work only on variables you create or populate in your lead list. They cannot directly overwrite system-managed default fields such as:

  • First Name

  • Last Name

  • Email

  • Company Name

  • LinkedIn URL

  • Phone

These default fields are system-managed. AI Variables are best used to create new clean, enriched, or personalized values that you can then insert into your sequence.

Did this answer your question?