Skip to main content

Save form responses with a webhook

Save every form submission as a new record. Tape gives you a webhook URL, and each response from your form tool arrives as a lead in your CRM database app.

Written by Leo

A webhook is a web address that other tools can send data to. This recipe uses the When a webhook is received trigger to catch a form submission and Create record to save it. It's meant to get leads from your website form into Tape without copying them over.

The automation Save form responses: When a webhook is received in Leads with the webhook URL, Copy, No webhook received yet, and Refresh, and Create a record in Leads with the rows Name, Message, and Email, before a test submission has arrived

What you'll need

  • A Leads database app with the text fields Name and Message and an email field Email.

  • A form tool that can send a webhook when someone submits a form.

Build the automation

  1. Open the Leads app and click the automations icon at the top right (Create and view automations).

  2. Select New automation, then select When a webhook is received.

  3. Under Send webhook to:, select Copy to copy the webhook URL.

  4. In your form tool, add the URL as the destination of the webhook. Then submit a test response.

  5. Back in the automation, select Refresh. The trigger shows No webhook received yet until Tape has received a call. Afterward, select Variables to see one variable for each key in the data your form tool sent.

  6. Select Add action → Create record. The step appears as Create a record in, followed by the app. Choose Leads if it isn't selected.

  7. Select Add field and add Name, then insert the matching variable from the webhook next to Set value. Repeat for Message. For Email, insert the variable next to Add values. Required fields are already listed with *.

  8. Select Create automation.

In the Leads app, opening the automations, selecting New automation and When a webhook is received, then selecting Copy next to the webhook URL under Send webhook to (the URL is hidden), with No webhook received yet below it

Note:

  • Keep the URL private. Anyone who has the webhook URL can send data to your automation. At this time, the editor has no option to reset the URL.

  • Field names matter. The variables are named after the keys in the data your form tool sends. If you rename a question, select Refresh again after a new test submission.

Connect Google Forms

Google Forms sends each response through a short script that you add to your form once.

  1. In your form, click ⋮ and select Apps Script. Older versions of Google Forms call this option Script editor.

  2. Paste the code below into the editor. Replace PASTE_YOUR_WEBHOOK_URL_HERE with the webhook URL you copied in Tape, and keep the quotes. The webhook URL starts with https://tapeapp.com/api/catch/.

  3. Select the save icon.

  4. Select Triggers in the menu on the left and add a trigger with these options: onSubmit, Head, From form, and On form submit. Save the trigger.

  5. If Google asks for permissions, allow them for your own account. You may need to select Advanced first.

  6. Submit a test response, then go back to the automation in Tape and select Refresh.

var POST_URL = 'PASTE_YOUR_WEBHOOK_URL_HERE';
function onSubmit(e) {
var form = FormApp.getActiveForm();
var allResponses = form.getResponses();
var latestResponse = allResponses[allResponses.length - 1];
var response = latestResponse.getItemResponses();
var payload = {};
for (var i = 0; i < response.length; i++) {
var question = response[i]
.getItem()
.getTitle()
.replace(/[^a-zA-Z0-9]/g, '_');
var answer = response[i].getResponse();
payload[question] = answer;
}

var options = {
method: 'post',
contentType: 'application/json',
payload: JSON.stringify(payload),
};
UrlFetchApp.fetch(POST_URL, options);
}

The script sends each question as a key. Characters other than letters and numbers in a question title become _, so the question Phone number arrives with the key Phone_number.

Connect Jotform

Jotform sends each submission to the webhook URL through its Webhooks integration.

  1. In your form, open the Settings tab.

  2. Select Integrations in the menu on the left and search for Webhooks.

  3. Paste the webhook URL you copied in Tape and complete the integration.

  4. Submit a test response, then go back to the automation in Tape and select Refresh.

The result

Each form submission creates a new record in Leads, for example "Dana Whitfield" with her email and message.

Variations

  • Add Send email to notify your sales team about each new lead.

  • Add a Conditional actions step to route leads from certain countries to a different database app.

  • Save to a different database app per form by building one automation for each form.

  • Work with the answers in Execute script. Read them from webhook_payload_parsed, for example webhook_payload_parsed.Phone_number for the question Phone number. Learn more about the Execute script action →

Learn more

FAQs

Can I save files from a form?

Yes, if your form tool sends the files with the webhook. They appear as Webhook files, which you can add to a file field with Add files.

Why did no record appear?

If no record appeared, it could be because:

  • The form tool didn't send the webhook. Submit a test response and select Refresh.

  • The automation is Paused.

  • A required field in Leads has no value. Set a value for every required field in Create record.

Can I use a different form tool?

Yes! Any tool that can send a webhook works the same way. Add the webhook URL as the destination in that tool, then follow the steps above.

Are you a developer using the Tape API for automations?

The automation API has its own documentation for developers. Full reference: Triggers in the developer docs →

Still have questions? Find answers and get help from community experts in the Tape community →

Did this answer your question?