问题
I have a script creating multiple Google Forms that all link to one Google Sheets. I use the function FormApp.create(name).setDestination(FormApp.DestinationType.SPREADSHEET,destSheetId);
multiple times to accomplish this. This works for the most part, however when I go to the destination Sheets, each Form pastes its information into a different gid of the Sheets. For example, one Form leads to https://docs.google.com/spreadsheets/d/1O8R/edit#gid=0
while another goes to https://docs.google.com/spreadsheets/d/1O8R/edit#gid=1
. Is there any way to either make the Script assign each Form the same gid, or view all the gids in the Sheet at the same time, or anything similar to this?
Thanks!
回答1:
It does not seem apparent anyway to have the form write to the same sheet within the same spreadsheet after you've set the destination. You would probably need to write the entire write To functionality of the responses and then have the actual form hidden.
Alternatively, you can create a "Master Tab" that compiles all the form responses. You would use the below function, updating the sheet and column names with yours to compile all the responses onto a single sheet. I start at Row2 and hardcode the headers in the master spreadsheet.
=SORT({'Form Responses 1'!A2:B;'Form Responses 2'!A2:B;'Form Responses 3'!A2:B},1,0)
来源:https://stackoverflow.com/questions/56309018/send-all-google-forms-to-the-same-sheets-gid-with-google-apps-script