Google Forms – How to Email Copy of Filled-Out Form Including Boilerplate

google-forms

I have constructed a Google Form used to book a community hall, and the form includes some Terms and Conditions that the user is agreeing to. I've displayed the Ts&Cs using the description field of a Section Header.

I've found some scripts that let me email the submitted data to our administrator to process the booking, and to the submitter so they have a copy of what they submitted. But I really want both emails to include a copy of the Ts&Cs that the user has agreed to. It's important for the user to have a record of what they've agreed to. And since they could change over time, we need to know which version each user has agreed to as well.

Is it possible to access the Section Header contents from a script when the form is submitted so I can include it in the email? It looks like the FormResponse object doesn't give you access to the headers. Or can anyone suggest an alternate way to solve this problem?

Best Answer

Since you asked about "an alternate way to solve this problem", I suggest using a required checkbox question with only one option: namely, the text of terms and conditions. This is more in line with the industry practice which requires a user to explicitly check a box next to T&C. The full text of this option will be included in the response, and can be emailed to the user by a script running on form submission.

One drawback is that options do not support line breaks. But one can separate sections with some ASCII art: I used 58 = signs below. This sort of formatting, replacing line/paragraph breaks with ===, can be done automatically if the document is long; the result is then copy-pasted into an option. The email-sending script can reformat the text for email, say, by replacement str.replace(/={2,}/g, '\n').

Using a part of Stack Exchange terms of service for illustration:

terms

I don't know what the maximal length of option text it, but it can be long (multiple screens to scroll).