Change form palette via google scripts

人走茶凉 提交于 2019-12-01 18:59:55

问题


I need a help. I am using Google App Scripts for creating Google Forms. How I can change form's color/palette?

I tried to find here https://developers.google.com/apps-script/reference/forms/, but nothing found.


回答1:


For the moment you can't, FormApp works with the first version of Forms, so for the moment no templates available programmatically.

Last news on the subject here




回答2:


Good to note that once you generate a form programmatically, you can then edit it just like a regular form. You get the link to the editable page from form.getEditUrl().




回答3:


I was facing the same issue here and found a workaround: create a "Template Form" with the proper theme you want, then you make a copy of it and do your coding to the new copied form.

The problem is, if you want to custom each form with a theme, it would need several template forms, and the code should be able to select the correct template. However, this is not my case. Here is a sample code:

var file = DriveApp.getFileById('your-template-form-id').makeCopy();
var form = FormApp.openById(file.getId());

Just make sure you remove the single question that is created within the template form if you're adding questions dinamically, else, add the questions you need.



来源:https://stackoverflow.com/questions/37302543/change-form-palette-via-google-scripts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!