Automatically answer form responses with OpenAI and Zapier

Automatically answer form responses with OpenAI and Zapier

Google Forms is a quick and flexible tool that lets you gather important information from customers and coworkers about pretty much anything. You might collect contact information from prospects, project details from your team, or even product feedback from existing clients. You might even include a section in your form for folks to ask questions—questions you need to then answer. 

Handling those queries manually doesn’t give you much in the way of reliability or speed, however. Some forms might slip through the cracks, or the amount of submissions you receive might snowball and you won’t have time to answer them all at once. 

Fortunately, you can use AI and automation to streamline the process. With a simple Zap—our word for Zapier’s automated workflows—you can collect those questions from Google Forms and generate automatic responses with OpenAI. Finally, you can either store those responses in a Google Sheet for review or send them directly as an email—automatically. We’ll cover both ways below. 

New to Zapier? It’s workflow automation software that lets you focus on what matters. Combine user interfaces, data tables, and logic with 6,000+ apps to build and automate anything you can imagine. Sign up for free.

Table of contents

Connect your form to OpenAI

Zapier lets you create automated workflows called Zaps, which send your information from one app to another. You can create your own Zap from scratch without any coding knowledge, but we also offer quick templates to get you started. 

If you’d like to start with a template, click the Use this Zap button below, and you’ll be taken to the Zapier editor. You’ll need to create a Zapier account if you don’t already have one. 

Both Zap templates will follow the same steps at the beginning, but you can choose to send your OpenAI responses to Google Sheets or send them via Gmail. Select which Zap template you’d like to use and follow our instructions for setting both up:

Set up your Google Forms trigger

You’ll need to create a Google Form for your users if you don’t have one already. You should have at least one submission in your Google Form. You’ll need multiple fields in your form that can collect the user’s name, email address, and questions so you can route them all to your Google Sheet for review. Here’s what our form looks like:

Screenshot of google form with prompt questions

Now let’s set up your trigger—the event that starts your Zap. If you’re using the Zap template, this will already be selected for you. Otherwise, head over to the Zap editor and select Google Forms for the trigger app and New Form Response for the trigger event. Click Continue.

Screenshot of google forms trigger step

Next, connect your Google Forms account, if you haven’t already, then click Continue. Now it’s time to set up the details of your trigger. Choose which form from your account you want to use. 

Screenshot of form field in trigger step in the Zap editor

In our case, this will be the form where folks ask their questions. Once you’ve selected your form, click Continue.

Now you need to test your trigger. Click Test trigger, and Zapier will provide a sample form response, which will be used to set up the rest of your Zap. Click Continue with selected record.

Screenshot of trigger test data in the Zap editor

Set up your OpenAI action step

Now let’s set up the action—the event your Zap will perform once it’s triggered. 

First, if you haven’t set up your Zapier connection to OpenAI, you’ll need to do that now. To start, go to platform.openai.com to log into your account. Expand the left sidebar, and click API keys.

Screenshot of API keys in OpenAI

Next, click + Create new secret key to generate a new API key. You’ll need this key to connect to your OpenAI account within Zapier. Copy this key and store it somewhere safe.

Screenshot of secret keys in OpenAI

Back in the Zap editor, select your action app and event. If you’re using the Zap template, these will be selected for you. Otherwise, add a new action step to the bottom of your Zap, then search for and select OpenAI for your action app and Send Prompt for your action event. Click Continue.

Screenshot of OpenAI app and event in Zap editor

Next, you’ll be asked to connect your OpenAI account to Zapier. Click on Choose an account… and either select an account from the dropdown menu (if you’ve connected OpenAI to Zapier before) or click + Connect a new account. Next, you’ll be asked to insert your OpenAI API key which you copied earlier, in a pop-up window.

Screenshot of OpenAI authorization pop up

Once you’ve done that, head back to the Zap editor and click Continue

Now’s the time to set up the action. 

The model gpt-3.5-turbo-instruct will already be preselected. Next click inside your Prompt field. You can map data from your Google Forms trigger by pulling in a specific value (like the question) from the dropdown, or you can type in text. 

In this case, I want to type out a custom message that tells OpenAI what to do with my Google Form field. I’ll type “Please answer the following questions,” and then I’ll pull in the form question fields from the dropdown.  

Screenshot of OpenAI prompt example

Once you’ve finished setting up these fields, click Continue

Now it’s time to test your action. Click Test step to send the prompt over to OpenAI. You’ll see a success message with the response OpenAI has generated. 

Screenshot of OpenAI test sample

Now it’s time to set up the final action step in your Zap. Keep reading to set up the Google Sheets action or skip ahead to send emails with Gmail. 

Note: Once OpenAI has generated a response, you’ll still need to send its response to another app. Most AI integrations require a three-step Zap.

Option A: Set up your Google Sheets action

For your Zap to work correctly, you’ll need to have header rows in the Google Sheet where you’ll collect your responses. If you haven’t already, create a Google Sheet and add column titles for each question, answer, and anything else you want to collect. 

Here’s what ours looks like:

Screenshot of Google Sheets set up

Now let’s set up your Google Sheets action in the Zap editor. Click the + button on the bottom of the screen. If you’re using the Zap template, this second action will already be set up for you.

Screenshot of Zap cross icon in Zap editor

Select Google Sheets as your action app and Create Spreadsheet Row as your action event. Click Continue. Again, if you’re using the Zap template, this will already be selected for you.

Screenshot of Google Sheets app and event in Zap editor

Connect your Google Sheets account, if you haven’t already, then click Continue.

Now it’s time to customize your action step. First, select the drive where your Google Sheet is stored in the Drive field. Then, select the spreadsheet you created for your questions and answers in the Spreadsheet field. And finally, choose the appropriate Worksheet (by default, it’s “Sheet1”).

Screenshot of spreadsheets in Zap editor

Now, it’s time to add your OpenAI responses to your Google Sheets rows. In our case, we will map both the questions from our Google form and the responses from OpenAI.

Click in any field where you’d like to add the Google Forms data, then select the appropriate data from the Insert Data dropdown. Do the same for your OpenAI responses, like so:  

Screenshot of fields mapped in zap

Once you’ve mapped all of your fields, click Continue.

Now, it’s time to test your Zap to make sure everything is set up correctly. Click Test step, and Zapier will send both your Google Forms data and OpenAI data to your Google Sheet, just how you’ve set it up. 

Screenshot of Google Sheets action test data

To make sure everything went well, open the Google Sheets spreadsheet to see for yourself. Here’s what our sample data looks like:

Screenshot of Google Sheets after Zap

If everything looks right, you’re now ready to publish your Zap. Now, every time someone submits a Google Form, OpenAI will generate a response to any questions and Google Sheets will be automatically populated with the responses. 

Option B: Send your OpenAI responses as emails

Don’t want to store those responses in Google Sheets but instead send them directly as emails? 

If you’d like to send OpenAI’s responses as an email, click the + button on the bottom of the screen. If you’re using the Zap template above, this second action will already be set up for you. 

Search for and select Gmail for your action app and Send email as your action event, then click Continue. If you’re using the Zap template, this will already be selected for you.

Screenshot of Gmail trigger and event in Zap editor

Connect your Gmail account to Zapier, then click Continue

Now it’s time to customize your action step. Add who you want to send the email to (the person who submitted the form), who it’s from (which will be the Gmail address associated with the account you connected to Zapier), and add any CCs or BCCs you’d like.

Screenshot of Gmail mapped fields in Zap editor

Fill in the Subject and Body fields. You can add data from your previous Google Forms and OpenAI steps by clicking in the field and selecting it from the Insert Data dropdown.

Screenshot of Gmail test <a href='https://gigs4five.com/my-account' target='_blank' rel='follow'>data</a> in Zap” class=”e4erbbm1 eknojd0 css-134qt3o e16539iq0″/></picture></div>
</div>
<p class=Once you’re finished customizing your action step, click Continue.

Next, click Test step to test your Zap. Once the test runs, an email will be sent to the email address you specified in your action step. Double check the email to make sure it looks right. Here’s what ours looked like:

Screenshot of email sent with Zap

If everything looks right, you’re now ready to use your Zap. Now, every time someone submits a Google Form, OpenAI will generate a response to any questions and Gmail will automatically send an email with the details. 

Use OpenAI and Zapier together to power your business

Now, whenever a new form is created, a spreadsheet response will automatically be created (or an email will be sent depending on your workflow) by OpenAI and Zapier. 

Want to find more ways to use AI to help you scale? See what else you can build with OpenAI today. 

This article was originally published in September 2023. It was most recently updated in July 2024.

by Zapier