Home > Software engineering >  Break line in google form title and description
Break line in google form title and description

Time:12-03

I created a google form and am trying to insert a line in a title. I found scripts for inserting lines in questions but couldnt find any script for title. I know that i need to use /n in script section to insert a line but dont know how to do it actually and what else script i need.

I need to write in my title lets say A /n B /n C

Can anyone help me please?

CodePudding user response:

Note that your / slash in wrong in your question. It's got to be \. Plug this into your app script and you should be able to see it work...

function quickTest() {
  const aForm = FormApp.getActiveForm();
  const doubleLine = "first line\nsecond line"

  aForm.setTitle(doubleLine)
  aForm.setDescription(doubleLine);
  var aItem = aForm.getItems()[0];
  aItem.setTitle(doubleLine);
  aItem.setHelpText(doubleLine);
}

enter image description here

  • Related