How to analyze and score leads with GPT-3 and Zapier

Prioritization is everything, so lead qualification is critical for sales and marketing

But lead scoring systems can often leave out qualitative information—such as open-ended responses—that would give a more accurate analysis of a prospect's potential value.

With Zapier and OpenAI (makers of ChatGPT), you can analyze and prioritize prospects based on numbers and insights without slowing down your sales pipeline. Our automated workflows called Zaps let you connect your essential apps to AI and thousands of other tools. 

In this tutorial, you'll learn how to connect OpenAI to your existing lead management tools so you can better prioritize your prospects. 

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

Before you begin

For this tutorial, I'll be using Typeform for incoming leads.  Be sure your form includes criteria that you use to prioritize leads. For example, you may ask leads to provide an estimated budget, select a specific service, or describe their request in an open-ended response.

I'm also using OpenAI's GPT-3 to analyze each submission and Google Sheets to store my lead data—along with OpenAI's priority notes. 

If you use different apps, don't worry—you can still follow along because the same concepts will apply. Make sure your form (or another lead source) has at least one submission and your spreadsheet or database is already set up with named columns. 

You'll also need an OpenAI account and an API key. If you don't have an OpenAI account yet, creating one is free. Once you create your API key, make sure to save it in a password manager because you won't be able to retrieve it again. 

How to analyze leads with GPT-3 and Zapier

You can create your own Zap from scratch with our point-and-click editor, but we also have quick templates to get you 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.

Here's how to set it up: 

  1. Connect a form app and test your trigger

  2. Connect to OpenAI and customize your prompt

  3. Connect a spreadsheet or database app and customize your action.

Set up your form trigger

First, set up your trigger—the event that starts a Zap. 

If you're creating a Zap from scratch, select the form app and event you want to use. The event will usually be something like New Entry or New Submission. Click Continue

Select the form app and event that will trigger the Zap.

Next, connect your form app to Zapier. If you haven't connected it to Zapier before, click on the dropdown, and select + Connect a new account. Otherwise, select your account from the dropdown and click Continue

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'd like to use and click Continue. We'll need an existing form submission to set up the rest of this Zap, so click Test trigger.

If your test is successful, you'll see the contents of your form submission. Click Continue. 

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

Connect to OpenAI and customize your prompt

Next, add your OpenAI action, which is the event your Zap performs once it's triggered. 

If you're using our Zap template, the action and event will be selected for you already. If you're building a Zap from scratch, search for and select OpenAI as the app, Send Prompt as the event, and click Continue

Select the OpenAI app and the Send Prompt event.

Connect your OpenAI account to Zapier if you haven't before. The editor will prompt you to provide an API key, which you created and saved earlier. 

Once you've connected your account, click Continue

Now for the most important part: we need to give OpenAI instructions, or a prompt, for what we want it to do. 

This prompt will consist of three parts: 

  1. The specific piece of instruction we want GPT-3 to accomplish. In the example below, we want GPT-3 to analyze the submission and return a priority level. 

  2. Examples to teach GPT-3 what we consider "high," "medium," and "low" priority. In the example below, I didn't use specific selection options. Instead, I'm giving the AI context for what I consider high priority. 

  3. Data from the form submission we want OpenAI to analyze. You don't need to include every selection option from your form, just the data that you want OpenAI to make a judgment on. 

Note: I included an instruction for GPT-3 to remove periods when returning a priority. While I can applaud AI's use of grammar, it might mess with dropdowns or selection items in your spreadsheet or database.

The GPT-3 prompt should include the instructions, an example to teach the AI, and then the form responses to analyze.

Notice that the example and submission parts of the prompt have headings. This will help the AI differentiate between a real submission and an example. 

Beneath the submission, make sure to map values from your form trigger. This is how you'll send form submissions to OpenAI to analyze. Just click inside the Prompt field and select values from your trigger to use. 

Click on a field in the Zap editor and select trigger values from the dropdown menu.

In the example below, I mapped the service my lead requested and the open-ended response requesting more details about their request urgency. 

Select dynamic values to use in the submission section of the GPT-3 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.

By default, the Maximum Length for the prompt is set to 256. If you anticipate that your prompt and the results OpenAI generates will exceed this, you can increase this. 

The maximum number of tokens in a GPT-3 prompt is set to 256 by default.

Tokens help OpenAI's GPT-3 (Generative Pre-trained Transformer 3) 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 customizing your prompt, click Continue and test your action. 

If it's successful, be sure to look closely at the results. You want to make sure that OpenAI made an accurate analysis based on your instructions. I also recommend checking beneath Usage to see how many tokens your prompt used to make sure nothing was cut off.

Check the results of the GPT-3 test in the Zap editor.

If you feel OpenAI's analysis was a little off, you can go back to the previous step, adjust your prompt, and retest it until you're happy with the outcome. Then click Continue

Set up your spreadsheet action

Now let's set up the final step of this workflow, which will create a new spreadsheet row with the form submission details and OpenAI's priority analysis.

If you're using a Zap template, Google Sheets will already be pre-selected for you. If you're creating a Zap from scratch, click the plus-button in the editor to add another step to your Zap. 

Then, search for and select Google Sheets as the app, Create Spreadsheet Row as the event, and click Continue

Select the spreadsheet app and event for the action.

Connect your Google account to Zapier (or select an existing account) and click Continue

Once you select the specific Google Drive, spreadsheet, and worksheet you'd like to use in your Zap, the Zap editor will expand to show fields that correspond to the named columns in your Google Sheet. 

The Zap editor will return spreadsheet columns as separate fields.

Start mapping values from your form trigger to the corresponding spreadsheet columns by clicking in each field and selecting the appropriate value from the data dropdown. 

Map dynamic values from previous Zap steps to send to the spreadsheet action.

Don't forget to map the results from your OpenAI prompt too. In the example below, I have a priority column in my sheet, so I want to map the AI result there. 

Select values from GPT-3 to pass on to the spreadsheet action.

When you're finished customizing your action, click Continue

Then, test your action. Zapier will create a new row in your spreadsheet, according to how you set it up. You'll see a success message if the test is successful. 

Review the results from the action test.

Check your spreadsheet to make sure everything looks correct. 

Check the spreadsheet app to review the results of the Zap test.

If not, tweak any steps in your Zap to get the desired result, and then make sure your Zap is on!

Qualify and prioritize leads with OpenAI and Zapier

Let AI and automation do the lead analysis so you can focus on closing sales. With Zapier, you can connect OpenAI to the essential processes that keep your business running. 

New to Zapier? It's a tool that helps anyone connect apps and automate workflows—without any complicated code. Sign up for free.

Related reading:

Build AI-powered workflows with OpenAI and Zapier. Start automating GPT-3.


Older Post Newer Post