I have created webhook to integrated the Form values into Google sheet.
It is working from the Dashboard when Tried testing data button, row inserted on click here
But I have tried to insert row from my html form with ajax post method,
my field values are not reflected there,
Here is my code snippet
$(document).ready(function () {
$('.ajax-form').on('submit', function (e) {
e.preventDefault(); // Prevent form from submitting normally
// Gather form data
const formData = {
A: $('#input_name').val(),
B: $('#input_email').val(),
C: $('#input_comments').val()
};
// Send AJAX request
$.ajax({
url: 'https://cloud.activepieces.com/api/v1/webhooks/<webhook_identifier>',
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(formData),
success: function (response) {
alert('Form submitted successfully!');
},
error: function (xhr, status, error) {
alert('An error occurred: ' + error);
}
});
});
});
But the data not reflected.
Your help is appreciated.