Google Apps 脚本表单服务

Google Apps Scripts Form service

我想知道google应用程序脚本表单服务中是否有任何功能可以在第一个问题的答案是某个选择时向另一个不同的问题添加另一个选择

source.setTitle('Choose source')
source.setChoices([
source.createChoice('instagram.com'),
source.createChoice('facebook.com'),
source.createChoice('twitter.com'),
source.createChoice('facebook_instagram')])

medium.setTitle('Medium')
medium.setChoices([
medium.createChoice('CPC')])

var opcSource = source.getChoices();
var opc = opcSource[0].getValue();

if (opc === 'instagram.com'){
medium.createChoice('HELLOHELLO');

这将取决于您的实施。您可以设置 createChoice(value, navigationItem) 并创建一个页面,其中将显示某个选项。

Creates a new choice with a page-navigation option that jumps to a given page-break item. This is equivalent to createChoice(value, navigationType) with navigationType set to FormApp.PageNavigationType.GO_TO_PAGE. Choices that use page navigation cannot be combined in the same item with choices that do not use page navigation.

您必须设置多个页面才能实现您想要的效果。你可以查看这个相关的SO post代码实现。

希望对您有所帮助。