Is it possible to send a google form with a trigger from a spreadsheet value? if so where would I go for help?
I Have created a google form that can be viewed here http://www.leadersoftomorrowisn.org/Become_a_Member.html
I want to be able to take the responses from question 5 "What Are You interested in?" and use them to send out specific google forms.
Is it possible to send a google form with a trigger from a spreadsheet value? if so where would I go for help with that?
Best, Maxwell
Let's assume that your Become a Member form has a spreadsheet that receives responses, and that you will create a script with a Form Response trigger that will review the responses as they come. We'll call that trigger
onFormSubmit()
. You have the option to create this trigger function contained within a Form Script, or within a Spreadsheet Script - either of those containers can receive the form responses. This choice will dictate which Event will be received byonFormSubmit()
- see Understanding Events for details.You will create (or already have) a set of additional Google Forms for the range of interests. Each of these forms has a unique id, and that's what you will use to obtain a URL for the form that you will send to respondents. See Class FormApp for API details. For each of your interest forms, you will need to embed the unique id into the script - that id appears in the URL while you're in the Form Editor, or on the Live Form.
In
onFormSubmit
, you can use the Form Submission Event to read a copy of the current response. Your question 5 is acheckBox
question, so all checked answers will be delivered in a comma-delimited string. (Be careful not to have commas in your questions!) In the example below, we'resplit
ting the response to question 5 to get an array of interests, and then sending email links to additional surveys based on those. It's quite crude, and very tightly coupled with your form, but it should do the trick.You could take this further, for instance you could generate a URL for a pre-filled version of the additional surveys, with the respondent's name already filled in.