HTML Form via Webhook to Google Sheet

New to n8n - been using Integromat for a while!

I have a HTML form that uses POST to submit the data: First Name, Last Name, Company, Email, Phone.

Webhook is in place, and the data is being passed to it.

Google Sheets is set up, and I can, for example, pull the data from the sheet into n8n.

I cannot get the data to pass from the Webhook into the sheet!

The data I need is in the “body” area of the JSON - how to I map that to the Google Sheet columns?

Many thanks!

Hey @seank1968!

Welcome to the community :tada:

You can use the Set node to map the values. You can find the steps in the Google Sheets documentation. Let me know if you still need help :slight_smile:

Thanks for the very quick reply!!

Yes, that helped a lot - have it working perfectly now - wasn’t as difficult as I thought!!

Can I get the Webhook to return the user to the web page that they came from after the form has been submitted? I have added a new Set to the end of the workflow and defined a string with the URL - then, in the Webhook, set:

Response Code: 301
Response Node: Last Node
Response Data: First Entry JSON

This results in the page displaying the JSON data defined in the last Set node and not an actual redirect to the URL - is it possible to do this?

Thanks again

It’s great that you were able to append data to your Google Sheet.

Talking about redirecting users, this post might help: How can I change webhook response? - #2 by jan :slight_smile:

Btw. just added a new answer to the linked post. The reason is that because of a new functionality that got added a few months ago the same can now be done simpler.

@harshil1712 @jan Many thanks for the really fast responses!

I have it working now!

1 Like

That’s amazing!

Have fun :slight_smile: