0

I want to generate personalized forms for 'n' number of people, based on data from a spreadsheet. The starting point was the script by Mogsdad (mogsdad-script), which worked great!

However, what I want to do is, in addition to certain text responses already filled in, I also want to personalize the form by changing the section header to something appropriate. For example, if I'm sending this form to my friend Sid, the section header should say something like: "Dear Sid,"

I am able to get a handle to the section headers inside the script by doing:

var header = form.getItems(FormApp.ItemType.SECTION_HEADER)[0].asSectionHeaderItem();

I can also change the header title like this:

header.setTitle('Dear ' + data[i][0]);

However, this is not on a per-response basis. This changes it for the form permanently. I cannot do something like this, which is possible for the other text based input fields:

formResponse.withItemResponse(header.setTitle('Dear ' + data[i][0]));

This gives an error.

Is there any way to personalize the fixed titles/headers in Google Forms programmatically?

Community
  • 1
  • 1
Sujay Phadke
  • 2,145
  • 1
  • 22
  • 41

1 Answers1

0

The short answer, sadly, is no. Pre filled urls and submit events are the only programable/semi-custom things you can do with a live form. For this very reason I chose to create a dynamic form as a Google standalone web app.

Gerneio
  • 1,290
  • 10
  • 13