---
title: "How to enrich lead info from sales forms with ChatGPT"
description: "Enrich your leads faster using ChatGPT so you can provide a more personalized buying experience. "
image: "https://images.ctfassets.net/lzny33ho1g45/4QKMbrB2OzsUqPUZmBtghY/c96fdb27bccddaf59c6b0ad3e1b39da7/app_tips__4_.png"
---

# How to enrich lead info from sales forms with ChatGPT

Enrich your leads faster using ChatGPT so you can provide a more personalized buying experience. 

You want to provide a good buying experience for your leads, but researching and gathering context for each prospect becomes tougher as you scale. Plus, you don't want to overload your potential leads with too many questions and risk turning them off.  

With Zapier and [ChatGPT](https://zapier.com/apps/openai/integrations), you can gather additional information about each lead without the extra effort and [keep your sales pipeline moving](https://zapier.com/blog/automate-sales-with-ai-and-zapier/). Our automated workflows called Zaps let you connect your critical apps to AI and thousands of other tools. In this tutorial, you'll learn how to connect ChatGPT to your lead management tools, so you provide a personalized buying experience at scale.

## Before you begin

In this tutorial, you'll create a Zap that will use ChatGPT's GPT-4 to gather more information about your new lead and attach it to a contact record in your customer relationship management (CRM) tool. 

You'll need the following:

- **An OpenAI account and API key:** You'll need this to connect ChatGPT to Zapier. If you don't have an OpenAI account, it's free to create one. Then, [create your API key](https://help.zapier.com/hc/en-us/articles/11283286953997-How-to-get-started-with-OpenAI-on-Zapier#additional-authentication-instructions) and save it in a [password manager](https://zapier.com/blog/best-password-manager/) because you can't retrieve it again.
- **A lead source with at least one submission:** Your lead source should ask for information that will help ChatGPT gather more context about your lead. For example, this could be the company's name, website, or the lead's social media handle. I'm using Typeform for this tutorial.
- **A CRM tool that tracks leads and sales activity:** I'm using HubSpot, which requires that a user has administrator permissions to connect to Zapier. You can search for your app [within our App Directory](https://zapier.com/blog/app-directory-tips/#help) or [Help Center](https://help.zapier.com/hc/en-us/sections/8495873920397-Apps-on-Zapier) to see what permissions you'll need.

## How to use ChatGPT to enrich lead information

This tutorial will help you practice using some [handy Zapier tricks](https://zapier.com/blog/zap-editor-tips/). You can create your own Zap from scratch with our [point-and-click editor](https://zapier.com/app/editor), but we also have quick templates to get you started. If you don't have a Zapier account yet, it's[ free to get started](https://zapier.com/sign-up). 

**How to create this Zap from scratch: **

1. [Connect your lead source and form to trigger your Zap](#trigger)
2. [Add a ChatGPT action and customize your prompt](#chatgpt)
3. [Add an action to search for existing CRM records](#search-crm)
4. [Add an action to attach a note to your lead](#note)

### Connect your lead source and form to trigger your Zap 

We'll start by creating the trigger—the event that starts a Zap. Select your lead source app and the event you want to use, which will usually be something like_ New Entry_ or _New Submission_. 

If you're following along, select **Typeform** as the app and_ _**New Entry **as the event. Select your app account, or connect it to Zapier if you haven't before, then click **Continue**. 

Then, select the form you want to use for this Zap, click **Continue,** and test your trigger. Zapier will look for an existing submission, which we'll use to set up the rest of this Zap. 

Once you see a success message, click **Continue**. 

### Add a ChatGPT step and customize your prompt 

Next, create your action, which is the event your Zap performs once it's triggered. In this step, ChatGPT will use the new submission from your lead to generate more information.

Select the **ChatGPT **app and the **Conversation** event. 

Next, connect your ChatGPT (OpenAI) account to Zapier if you haven't before. You'll need to provide an API key you created and saved earlier. Click **Continue** once you've connected your account. 

Now you need to provide ChatGPT with instructions—or a prompt—for the information you need it to collect. We'll use the `gpt-4o-mini `model, already pre-selected in the editor. 

The prompt will consist of two parts: 

1. **The specific instructions for ChatGPT: **In the example below, I want ChatGPT to use the information in the Typeform submission to describe the problem my lead wants to solve and use their company website to generate potential talking points for the sales team. I limited ChatGPT to three sentences so it will be easy to scan.
2. **Information about our lead that will help ChatGPT find additional context.** For this prompt, I included the lead's name, email, company, and website. Since I also want ChatGPT to generate sales talking points, I included the lead's request as well.

I generally like to include headings in my prompts to differentiate between the prompt and app data I want the AI to use. Plus, it helps structure the prompt so you're not using more tokens than necessary.

Beneath the response_ _heading, map values from your Zap's trigger. This is how you'll provide the lead data ChatGPT needs for information gathering. Click the **+ icon** inside the _User Message _field and select the dynamic values from your trigger to use. 

Once you've completed your prompt, there are additional options you can customize to get the outcome you want: 

- **Temperature:** You can lower the _Temperature_ value for more predictable responses from ChatGPT or increase it for more creative responses. My example calls for more creativity, so I kept the default value.
- **Maximum Tokens: **By default, ChatGPT sets this to 1024 tokens. I don't need to increase this for my example, but you can adjust the limit if you think your prompt and completion will exceed this.
- **Top P: **The "Top P" field in ChatGPT's configuration refers to nucleus sampling, a method that determines which tokens the model considers based on their cumulative probability. You can leave this set to the default value.

Once you're done, click **Continue** and test your action.  

If it's successful, look closely at the results to ensure ChatGPT provided the additional lead information you wanted. 

If you think ChatGPT's intel-gathering needs more work, you can go back to the previous step, tweak your prompt, and retest until you're satisfied with the results. Once it looks right, click** Continue**. 

### Add an action to search for existing CRM records 

Before you attach the AI-provided information to your lead, you need to add a search step to check for an existing contact record in your CRM. This helps prevent duplicate CRM records and ensures this new information is associated with a contact and company so it's easy to find. 

Select your CRM app and the search action you want to use. Search actions for CRM apps will usually be something like_ Find Contact_.

If you're following along, select the **HubSpot** app and_ _**Find Contact **as the event. Select your app account, or connect it to Zapier if you haven't before, and click **Continue**. 

Next, you need to set the specific search criteria Zapier will use to check your CRM records. 

No matter which CRM tool you use, you'll need to specify the contact property you want Zapier to check and the value to look for. 

Click on the _First search property name_ field and select the contact property you want to search. In this example, I want to search by the contact's email address. 

Since you want to use the information your new lead provided to search your CRM records, click on _First search property value_ field and field map a dynamic value from your trigger.

For this example, I selected the email address my lead provided in my Typeform trigger.

Your CRM may allow you to set a backup property and value to search in case it can't find anything. If you'd like to set this up, go ahead and do so. 

Below, I've set up this step to search the company and website properties as a backup if it can't find the specified email address in HubSpot. 

If your CRM lets you search for existing records and create new ones in the same step, you'll see a checkbox asking if you want to create a new record if it doesn't exist. Click the checkbox since we want this new lead in our CRM. 

If you click the checkbox, the Zap editor will prompt you to customize what should go in your new contact record. 

Map the fields from your lead source to the appropriate contact properties. Don't worry about mapping anything from ChatGPT—we'll do that in the next step. 

Once you've configured everything, click **Continue**. 

Next, test the search step and review the results. When you test this step, Zapier will search for an existing record. If it doesn't exist and you've set it up to do so, it will also create a new record.

If your test created a contact record, go to your CRM and check that it was created correctly. 

If you see a failure message in the Zap editor instead and you know the contact record exists, go back to the previous step, adjust your search criteria, and retest. 

Once you've verified that your search step works, click **Continue**. 

### Add an action to attach a note to your lead

Finally, you'll create the final step of this Zap, which will create and attach a note to your lead with the information ChatGPT generated. 

Depending on your CRM app, you may have an action that lets you create notes or you may need to use a webhook to do so. 

If you're following along, select the **HubSpot** app and the_ _**Create Engagement** event, then click **Continue**. 

HubSpot will ask if you want to prevent this task from proceeding if it can't associate this note with the specified records. By default, this will be _False_, which is what we want. 

Then, click on the dropdown under _Engagement Type_ and select **Note**. 

If you want a specific person to see the note, [you can use custom values](https://zapier.com/blog/zap-editor-tips/#custom-value) to dynamically assign the lead's contact owner to the note. 

If your search step found an existing contact record, click on the **Assigned to** field, select your CRM search step, and map the **Contact Owner** value. 

Since I created this contact record in the previous search step, I don't have an owner assigned to this lead yet. HubSpot and many CRM apps won't return empty fields, which can pose a problem if you need to use a particular field in a Zap. 

Fortunately, we can solve this issue using a [command to generate a placeholder value](https://zapier.com/blog/zap-editor-tips/#missing-fields). That way, you can assign this note to a contact owner every time this Zap runs. 

**Here's how: **

1. Click on your search step in the Zap editor.
2. Then, copy the step ID from your browser's address bar. The step ID will be the set of characters after `https://zapier.com/editor/{ZAP ID}/draft/` starting with `_GEN_ `or a number.
3. Return to your Create Engagement step and click the **Assigned To** field.
4. Click on the **Custom tab **and enter the following command: `{{your-step-id__name of your contact owner field}}`

The Zap editor will automatically generate a placeholder value from the previous step,  indicated by the app icon and step number. 

Whew. Now for creating the actual note. You can add a mix of static text and dynamic values mapped from previous Zap steps. This is where we'll add our AI-generated lead info. 

Click on the **Note Body** field, select the previous ChatGPT action, and click on the **Reply** value to map to the note. 

In this example, I also included one of the responses from my lead form. If you're a HubSpot user, you can format notes with rich text with [simple HTML](https://www.w3schools.com/html/html_formatting.asp) in the _Note Body_ field.

You can also connect related CRM records to your note, such as emails, contacts, deals, and more. 

In the example below, I want to associate the note to my lead, so I've mapped their email address from the previous search step. 

I also want to attach this note to their contact record. Click on the_ Id's of the contact objects that should be associated with engagement_,_ _click on the **Custom** tab, then select the contact's ID from the previous search step. 

You can associate products, deals, and other types of records to your note if you'd like. Once you're done, click **Continue**.

Finally, test this step. Zapier will create a new note and attach it to the specified records. 

If everything works, you'll see a success message. 

Be sure to check your CRM record to see how your note looks. 

If everything looks okay, your Zap is ready to use!

## AI and automation: The dynamic duo for enriching leads

AI and automation can research and [enrich your leads](https://zapier.com/blog/lead-enrichment) and provide additional context for your sales and marketing teams, so you can focus on delivering a better buyer experience. Zapier lets you connect ChatGPT to business-critical processes so you can work more efficiently. 

_This article was originally published in May 2023 and was most recently updated in February 2025 by Elena Alston._