I have an app that sends emails after a form is submitted and I would like to use the form response data from a couple of questions in the email subject.
currently the email subject is pulling from this
const subject = "Text -" this.title
I was thinking, but am not sure how to reference a specific form question using getResponse() or if this is the proper solution const subject = "Text -" this.title getResponse()
CodePudding user response:
It's very likely that the source that lead you to getResponse()
was refering to FormApp.ItemResponse.getResponse.
In order to be able to used this method, first your code should grab the FormApp.FormResponse which is usally got from for form submit event object from a Form trigger, but the project that you are referreing is using a spreadsheet trigger which might make things easier as it already includes two properties with the response values:
- values
- namedValues
For details please checkout https://developers.google.com/apps-script/guides/triggers/events#form-submit
Related