使用Google Apps脚本将所有Google表单发送到相同的表格表单 [英] Send all Google Forms to the same Sheets gid with Google Apps Script

查看:74
本文介绍了使用Google Apps脚本将所有Google表单发送到相同的表格表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个脚本可以创建多个Google表单,这些脚本都链接到一个Google表格.我多次使用功能FormApp.create(name).setDestination(FormApp.DestinationType.SPREADSHEET,destSheetId);来完成此任务.这在大多数情况下都是有效的,但是当我转到目标表格时,每个表单都会将其信息粘贴到表格的其他页面中.例如,一种形式导致https://docs.google.com/spreadsheets/d/1O8R/edit#gid=0,而另一种形式导致https://docs.google.com/spreadsheets/d/1O8R/edit#gid=1.有没有办法使脚本为每个表单分配相同的gid,或者同时查看工作表中的所有gid,或者类似的方法?

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?

谢谢!

推荐答案

设置目标之后,将表单写入同一电子表格中的同一工作表似乎还是不明显.您可能需要编写响应的整个write To功能,然后隐藏实际的表单.

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.

或者,您可以创建一个主选项卡"来编译所有表单响应.您将使用以下功能,用您的表和列名更新表名,以将所有响应汇总到一张表中.我从第2行开始,并对主电子表格中的标题进行硬编码.

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)

这篇关于使用Google Apps脚本将所有Google表单发送到相同的表格表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆