Google Apps Script中的表单动态选择选项 [英] Dynamic selection options in Google Apps Script for forms

查看:122
本文介绍了Google Apps Script中的表单动态选择选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有



addPageBreakItem



createChoice


I have this form:

If you see List Items - Student Name and Grades are getting populated from a Google Sheet.

What I want to do now is upon selection of List Item Grade, show only those students that belong to that particular grade in the "Select Student" selection...

How can it be done, because form has only two triggers: onOpen and onEdit?

解决方案

As far as I know, this type of client side event does not exist in Google Forms. The scripting mechanisms of Google Apps Script are designed for creating forms and other documents, but do not reach very far for client-side functionality.

What I suggest is that you split the form into multiple pages and use the "Go to page based on answer" feature to achieve your desired functionality.

Use form.addPageBreakItem() to create pages and use the item.createChoice(value, PageBreakItem) to navigate to the correct page.

References:

Google Apps Script Forms Service

addPageBreakItem

createChoice

这篇关于Google Apps Script中的表单动态选择选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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