Reputation: 5160
I need to be able to insert both hyperlinks and newlines into the help text of my Google Forms using Google App Script. Neither is possible.
For links I have tried (to no effect):
http://link.com/path
<a href='http://link.com/path'>http://link.com/path</a>
For newlines I have tried (to no effect):
\n
\\n
\n
My code follows:
function createForm() {
var form = FormApp.create('Amazon Open Source Project Classification');
form.setDescription("This form is for labeling open source projects using the project url and description with the following 4 categories:\n\n1) \
API - this is an API library that can only be used to access an Amazon Web Services (AWS) API\n2) EDUCATION - this is an educational project or example \
of how to use an AWS API\n3) GENERAL - this is a general purpose open source project with utility for the public\n4) DATASET - this is a dataset \
published by researchers as part of their researchz\n")
form.addMultipleChoiceItem()
.setTitle("What category does the project fall under?")
.setHelpText("<a href='http://github.com/alexa/alexa-skills-kit-sdk-for-nodejs'>http://github.com/alexa/alexa-skills-kit-sdk-for-nodejs</a>\n\nThe Alexa Skills Kit SDK for Node.js helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.")
.setChoiceValues(['API','EDUCATION', 'GENERAL', 'DATASET'])
Logger.log('Published URL: ' + form.getPublishedUrl());
Logger.log('Editor URL: ' + form.getEditUrl());
}
Upvotes: 1
Views: 615
Reputation: 8069
Update: 2025
The Google Forms UI has been changed and is possible to add a hyperlink in a question Title. It's also possible to format text. However it appears that this must be done manually (via Forms UI) since these options are not (yet??) available in Apps script.
Google Forms UI
Upvotes: 0
Reputation: 2608
It's not possible to set an hyperlink in that field as the method setHelpText requires a String parameter and the Forms UI doesn't interpret it as HTML.
However, you can submit a Feature Request into Google's Issue Tracker here using the Component Public Trackers > G Suite Developers > Apps Script
(as this would be for the Apps Script FormApp Class).
Upvotes: 1