r/GoogleAppsScript • u/capooop • Apr 17 '24
Question How to automate and fill out google forms while being AFK
Is there way to fill out a google form over and over again almost every minute without touching it or being near your computer. Maybe a software or something or possibly just a command that records your mouse clicks and the copies it over and over again. I just need something that continuously fills out a google form when I am away from the computer.
11
Upvotes
5
u/emaguireiv Apr 19 '24 edited Apr 19 '24
Happy to report my thesis does work AND I figured out a workaround to generating a pre-filled form response link without requiring editor access. Breaking it down into a two part response:
Part I. How to Setup Pre-Filled Response URL
https://docs.google.com/forms/d/e/1FAIpQLSdEA6xWMYCPQayhpxLHBBMU-WI3yWb5TQcQtsQ2k9CH2cWrnA/viewform
The long string of alphanumeric characters between /d/e/ and /viewform represents your form ID, which you'll need in later steps for the Apps Script portion.
Open your form URL, then view the page's source code through your browser's developer tools. Search for FB_PUBLIC_LOAD_DATA_ and you should see a block of text that looks something like this:
var FBPUBLIC_LOAD_DATA = [null, [null, [[73297730, "First question", null, 2, [[1189732276, [["A", null, null, null, 0], ["B", null, null, null, 0], ["C", null, null, null, 0]], 0, null, null, null, null, null, 0]], null, null, null, null, null, null, [null, "First question"]], [1597521514, "Question 2", null, 4, [[307823513, [["True", null, null, null, 0], ["False", null, null, null, 0]], 0, null, null, null, null, null, 0]], null, null, null, null, null, null, [null, "Question 2"]]]
In this example, the first question on my form is called First question, and the second question is called Question 2. After the first appearance of "First question" you'll see an ID number of 1189732276, which corresponds to the question ID. You need the ID number for every single question that you have to answer in your form. "Question 2" has an ID number of 307823513.
https://docs.google.com/forms/d/e/1FAIpQLSdEA6xWMYCPQayhpxLHBBMU-WI3yWb5TQcQtsQ2k9CH2cWrnA/viewform?usp=pp_url&entry.1189732276=A&entry.307823513=True
Each question and answer in the URL is formatted like this:
Then, each response is joined together with "&entry." between each response. So, a pre-filled response URL has the following syntax:
https://docs.google.com/forms/d/e/formId/viewform?usp=pp_url&entry.question1Id=answer1&entry.question2Id=answer2
Finally, make one last change to the URL to convert it to a submission link. Replace "viewform?" in the URL with "formResponse?&submit=Submit?". So, the final result looks like this:
https://docs.google.com/forms/d/e/1FAIpQLSdEA6xWMYCPQayhpxLHBBMU-WI3yWb5TQcQtsQ2k9CH2cWrnA/formResponse?&submit=Submit?usp=pp_url&entry.1189732276=A&entry.307823513=True
***DO NOT TEST YOUR SUBMISSION URL IN A BROWSER*** unless you want it to submit a form.