rjurney
rjurney

Reputation: 5160

How do you insert newlines and hyperlinks into Google Forms question help text?

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):

For newlines I have tried (to no effect):

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

Answers (2)

Tedinoz
Tedinoz

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

FormUI

Upvotes: 0

Jescanellas
Jescanellas

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

Related Questions