Need help with creating google sheet webhook

Hey guys,

I am creating a kind of a Web Hook to post a new row to my Google Sheet everytime a user submits a form.

I wanted to implement an AJAX request to the URL for my web app/script whenever the form is submitted but I’m having problem as the example code i have contain the form id instead of the ids for the various input and text fields i want to capture.

This is what the example code looks like:

var $form = $('form#test-form'),   
        url = 'https://script.google.com/macros/s/abcdefghijklmnopqrstuvwxyz1234567890/exec' 

$('#submit-form').on('click', function(e) { 
e.preventDefault(); 
var jqxhr = $.ajax({
    url: url,
    method: "GET",
    dataType: "json",
    data: $form.serializeObject()
  }).success(
 // do something
  );
})

I have 11 input fields and two text fields which i need to capture to my google sheets. I took care of the coding on Google Sheet part. I just need help on coding the website.

Everything is getting stored in wix database seamlessly.

Also, I already have a onclick code implemented for my submit button, should i enter this code below ?

If you can help me I would be ever grateful.

Hi,

Take a look at the article Accessing 3rd Party Services for information on this subject. You can also follow the tutorial How to Send an Email on Form Submission for a live demonstration of accessing a 3rd party service.

You can also use the HtmlComponent , although it is not as secure as the above methods. See the article Working with the HTML Component in Wix Code .

Have fun,

Yisrael