简体   繁体   English

Google Apps脚本表单服务

[英]Google Apps Scripts Form service

I want to know if there is any function in google app script form service for adding another choice to another different question when the answer of the first question is a certain choice 我想知道是否有添加另一种选择到另一个不同的问题,谷歌应用程序脚本形式服务的任何功能时,第一个问题的答案是必然选择

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');

This will depend on your implementation. 这将取决于您的实现。 You can set the createChoice(value, navigationItem) and create a page where a certain choice item wil go. 您可以设置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 . 这等效于将navigationType设置为FormApp.PageNavigationType.GO_TO_PAGE createChoice(value, navigationType) Choices that use page navigation cannot be combined in the same item with choices that do not use page navigation. 使用页面导航的选项不能与不使用页面导航的选项合并在同一项目中。

You'll have to set multiple pages for you to achieve what you want. 您必须设置多个页面才能实现所需的功能。 You can check this related SO post for code implementation. 您可以检查此相关的SO帖子以实现代码。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM