Send all Google Forms to the same Sheets gid with Google Apps Script

不羁的心 提交于 2020-01-06 04:35:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!