r/GoogleAppsScript • u/urutau_ • Nov 13 '22
Question Making a Google Form populate a Google Spreadsheet in real time. Is there a way?
I am creating a Google Form that demands the recall of information from the current section.
For example, let's suppose I created five questions so the user adds the name of three colors, and they chose "red", "green" and "blue". In the next page, I created another question where I want they to point out what color, out of these three, is their favorite. For this, I must populate the list of option with the answers given earlier in the same section.
I am aware that Apps Script can be used to recall information from the Spreadsheet containing the answers from previous sections, as these answers are already present in the Spreadsheet while the answers from the current section will only be added to the Spreadsheet when the Form is finally submitted.
So I'd like to know if there is a way to populate the Google Spreadsheet per page instead of having to wait until the form is finished.
If it is not possible, is there any other friendly tool to accomplish that?
1
u/arnoldsomen Nov 13 '22
I am aware that Apps Script can be used to recall information from the Spreadsheet containing the answers from previous sections, as these answers are already present in the Spreadsheet while the answers from the current section will only be added to the Spreadsheet when the Form is finally submitted.
Really? This is news to me.
1
u/urutau_ Nov 13 '22 edited Nov 13 '22
Yup, you can do that using addons like Form Ranger ou by editing the Apps Script (you can find some tutorials searching for "dynamic Google Form", for example). It's very useful -- but not enough for what I need right now, unfortunately.
Edit: Considering the downvotes, I now think you were referring to Forms only adding entries to the Spreadsheet after submission. Anyway…
1
u/booboouser Nov 14 '22
I have a sheet that takes an answer and adds it to a dropdown, BUT it only adds AFTER form submission. The answer is ready to select next time you open the form. I followed Ben Collin's tutorial on this.
1
Nov 13 '22
[removed] — view removed comment
1
u/urutau_ Nov 13 '22
Hm… I didn't really think about this last possibility, as I was only aware that I could transfer data the other way around (from a spreadsheet to a doc). It could really help considering the intended use.
I'll give a look into that, thanks!
4
u/dimudesigns Nov 13 '22
That's not possible with Google Forms. They only allow you to track submissions, and this holds true for both the built-in GAS APIs and the relatively new Form REST API.
You can try checking out different form building software to see if they support that kind of functionality and possibly integrate it via some API. Or, assuming you're technically inclined, you can build your own form - either from scratch (using raw HTML/CSS and Javascript) or leveraging a front-end framework - and deploy it as a GAS Web App.