问题
In google forms, using google apps script, will I be able to use the values submitted through the form to set the confirmation message which is to be displayed to the user, who has submitted those values? Note that, the default confirmation message now is "The response has been recorded" and I know that I can change this text to other text, but what I need is to manipulate the message based on responses of the user.
回答1:
When you .setConfirmationMessage(message)
on form submit, the current message still gets displayed and your new one won't show up until the next form submission. Seems like the order of operations is - 1) submit values of form to spreadsheet 2) show confirmation message 3) run "on form submit" functions.
So, we can't conditionally set and immediately display a custom message for the current user's response based on what their answers were. The confirmation message is "front-loaded" in a sense.
来源:https://stackoverflow.com/questions/22738404/how-to-set-confirmation-message-based-on-form-responses-in-google-forms-using-ap