Automatically submitting data to Google Forms using JavaScript bookmarklet

I want to build a JavaScript bookmarklet that can extract information from web pages and automatically send it to a Google Sheets through a Google Form. I’m having trouble getting the form submission to work properly.

Here’s what I’ve tried so far:

var submissionForm = document.createElement("form");

submissionForm.action = "https://docs.google.com/forms/d/e/1FAIpQLSc_example_form_id/formResponse";
submissionForm.method = "POST";
submissionForm.className = "auto-submit-form";
submissionForm.innerHTML = [
  "<input id='field_1' name='entry.123456789' value='" + dateValue + "'/>",
  "<input name='entry.987654321' value='" + userEmail + "'/>",
  "<input name='entry.456789123' value='" + accountNumber + "'/>"
].join("");
submissionForm.submit();

console.log(submissionForm.innerHTML);

The problem is that nothing gets saved to the Google Sheet when I run this bookmarklet. I can’t see any network activity in the browser dev tools either. Is there a way to capture Google’s response or check if the submission worked?

I’m wondering if I should try a different approach using the viewform URL instead of formResponse. The actual form I’m trying to submit to is a standard Google Form. How can I programmatically fill out the form fields and submit them from my bookmarklet while staying on the original page that I’m parsing data from?

append the form to document.body before submitting - had the same issue and that fixed it. also double-check your entry IDs by inspecting the google form source. sometimes the form gets created but doesn’t actually submit because it’s not properly in the dom.

You’re hitting CORS restrictions. Google Forms blocks direct submissions from external domains for security - that’s why you don’t see any network activity in dev tools. The browser kills the request before it even goes out.

I ran into this exact issue building a similar tool. What worked for me: create a hidden iframe and submit through that. Set the iframe’s src to your Google Form URL first, then access the form elements inside the iframe and fill them with your data.

Alternatively, skip Google Forms entirely and use the Google Sheets API directly. You’ll need to set up authentication, but you get way more control and better error handling.

You could also try a proxy server or something like Zapier as a middleman. The formResponse endpoint you’re using is right, but without proper CORS headers, it won’t work from a bookmarklet on a different domain.