Google Apps Script中的表单动态选择选项 [英] Dynamic selection options in Google Apps Script for forms
问题描述
我有
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
这篇关于Google Apps Script中的表单动态选择选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!