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:
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.](https://images.ctfassets.net/lzny33ho1g45/6k35FG0lYYiQRJCIZql98M/3c0576dd6b56a2c79586195698ad0b70/4251753bc538226b5d6a34f955ca95eb.png?w=1400)
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.](https://images.ctfassets.net/lzny33ho1g45/5iKAhSVUDTNAvvvtF9nepS/af0a73dbf31f036922399bf80f1182de/be441af1a867c381f3d5fb5ebb6aa28a.png?w=1400)
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.](https://images.ctfassets.net/lzny33ho1g45/6oWUhh2TxLpkjAvSmJICow/ccf3e70175e992f99a12d09715120f34/1488c00d3e084a83fc1f5404c382d5b5.png?w=1400)
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:
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.
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.
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.](https://images.ctfassets.net/lzny33ho1g45/5i1fK3KzOVOlWTQiT0mnyG/2f2576fec997c0c4941c40b476c7e8e5/d52184f48d7d2cb2d34fc24d73a3207e.png?w=1400)
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.
Learn more: How to write an effective GPT-3 prompt
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.](https://images.ctfassets.net/lzny33ho1g45/75uagRLSkFzwwhw6TnSHtt/d6ee18cff09b8648788797b2e71a6611/0421b337f58fb238400dddbf802fe6e1.png?w=1400)
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.](https://images.ctfassets.net/lzny33ho1g45/gyMR9ILXWZjC3pYSDd9W7/a69075474fc17f4304bc893343b350eb/fbaa9fdf0f77d965fa7f417e61bc5881.png?w=1400)
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.](https://images.ctfassets.net/lzny33ho1g45/5GGovwnT8jK6YPNmkKCVPh/934effcaf70ec43d9ff776b5d0ac52c1/58b19ab39cb9a6d16817e2de3b466821.png?w=1400)
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.](https://images.ctfassets.net/lzny33ho1g45/17uPFygHEiHWWbrTPQfPDX/379a382713ed2b243c2a3799e1e98844/240c402fdb4e49adbefdbbb04fdd78f8.png?w=1400)
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.](https://images.ctfassets.net/lzny33ho1g45/7mAqbu301lZncEY0IMooZC/35f59063040a4130f99e900af68180b1/a361026d1cfe041eb973ca6a05d970e3.png?w=1400)
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.](https://images.ctfassets.net/lzny33ho1g45/7a5lMeSNjRpxALwHxD6zUN/71bc5ab6947a956c61756a713166b5df/8b8821ae2162f0d3c90bf90e8bfed63d.png?w=1400)
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.](https://images.ctfassets.net/lzny33ho1g45/4QwYUQayIFMMGDtBNu5s1H/5fd585aa138ecbdd83c72e6de21d6fbb/84297e199546cf87aab6a828defb30a9.png?w=1400)
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.](https://images.ctfassets.net/lzny33ho1g45/2hgQkQmSlKZ9DsnJbiqXJC/2326eb23411b0dd75d7f614770c85c76/e9204b1779a5e49b0ea4659103a504f2.png?w=1400)
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.](https://images.ctfassets.net/lzny33ho1g45/1fS9UHLRhMSI2T3LL3V5MH/8277dc1b4a0e46092dc0fdde1fd2e590/d20df8bb45bf3b71b45c40976e361c79.png?w=1400)
Check your spreadsheet to make sure everything looks correct.
![Check the spreadsheet app to review the results of the Zap test.](https://images.ctfassets.net/lzny33ho1g45/6azBpbYLgBEbuvw9H6CZcL/ddde92855a60b2c9afc89b2662f3a49f/15f4b758b8e85251cdfed1c305f6d37c.png?w=1400)
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.