Skip to content

How to enrich lead info from sales forms with ChatGPT

By Krystina Martinez · February 19, 2025

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, you can gather additional information about each lead without the extra effort and keep your sales pipeline moving. 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 and save it in a 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 or Help Center to see what permissions you'll need.

This workflow requires a multi-step Zap, available on a paid Zapier plan or during a free trial. Learn more about multi-step Zaps.

How to use ChatGPT to enrich lead information

This tutorial will help you practice using some handy Zapier tricks. You can create your own Zap from scratch with our point-and-click 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

To get started with a Zap template—what we call our pre-made workflows—just click on the button. It only takes a few minutes to set up. You can read more about setting up Zaps here.

How to create this Zap from scratch: 

  1. Connect your lead source and form to trigger your Zap

  2. Add a ChatGPT action and customize your prompt

  3. Add an action to search for existing CRM records

  4. Add an action to attach a note to your lead

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.

Screenshot of Typeform trigger

For each app you connect, Zapier will ask for a general set of permissions which allows you to be flexible with your Zaps. The only actions Zapier takes on your app accounts are those a given Zap needs to accomplish what you've set up.

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. 

Test the trigger in the Zap editor and review the app data returned.

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.

Screenshot of ChatGPT action

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. 

Models are algorithms that use large amounts of data to identify patterns and make predictions for completing specific tasks, such as generating text or images. OpenAI models have different capabilities, so choose the appropriate model for your request. Learn more about the models available, and use this tool to try out different settings.

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. 

Screenshot of ChatGPT user message

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. 

Screenshot of form value mapped to prompt

A dynamic value is any data from a previous Zap step that you've mapped to a field in the Zap editor. When you map a dynamic value—such as a contact name—what you see in the editor is a placeholder. Field mapping dynamic values are how you pass data from one app to another. Once your Zap is turned on, Zapier will send the information that the field contains every time your Zap runs.

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.

Screenshot of ChatGPT tokens

Tokens help OpenAI's (ChatGPT) language models assign meaning and predict the next likely text. Tokens are about four characters long, on average. You can use OpenAI's Tokenizer tool to see how many tokens your prompt uses.

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. 

Screenshot of data from ChatGPT

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. 

A search action—or a search step—can look for existing information in your apps that you can reference in a later Zap step. Search steps are often paired with another action, allowing Zaps to update existing data, check for duplicates, or create new records when needed. Check out our guide to using search steps in Zaps.

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.

Screenshot of HubSpot action events

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. 

Select the HubSpot property to search.

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.

Screenshot of search property value

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. 

Add up to three backup searches.

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. 

Click the checkbox to create a contact in the same step, if one can't be found.

If your app doesn't have this option, don't worry. Be sure to set Should this step be considered a success if nothing was found? to Yes.  Finish creating and testing your search step. You can add a path step—available on Professional plans and up—to create one path that creates records if none exist. Learn more about using paths and search steps.

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

Customize the new HubSpot contact the Zap step will create.

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. 

Quick tip: Since CRMs have dozens of properties, you can use Command+F (Mac) or Ctrl+F (Windows) in the Zap editor to jump to the specific fields you want to fill out. This will save you some scrolling! 

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.

Note: If you searched and created a new item in the same step, _Zap_data_was_found will still be false since the contact didn't exist before the current Zap run. This helps Zapier better differentiate between existing information and new data.

Test the search step and review the results.

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

Check HubSpot to review the contact created.

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

Screenshot of HubSpot app action

Need to use a webhook to create a note in your CRM? Learn how to add a webhook to your CRM in this tutorial

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. 

Screenshot of task associations

Then, click on the dropdown under Engagement Type and select Note

Screenshot of engagement type

If you want a specific person to see the note, you can use custom values 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. 

Select the Contact Owner from the previous Zap step.

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. 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. 

Use a command to map missing fields from previous Zap steps.

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. 

Screenshot of ChatGPT's reply field

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 in the Note Body field.

Screenshot of HTML code

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. 

Map the contact email value.

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. 

Screenshot of HubSpot ID

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. 

Screenshot of HubSpot engagement success message

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

The action will create a HubSpot note and attach it to a contact.

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 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.

Get productivity tips delivered straight to your inbox

We’ll email you 1-3 times per week—and never share your information.

Related articles

Improve your productivity automatically. Use Zapier to get your apps working together.

A Zap with the trigger 'When I get a new lead from Facebook,' and the action 'Notify my team in Slack'