Search code examples
google-apps-scriptgoogle-forms

Programmatically stop the submittal of a google form based on selected values using Apps Script


I have a google form that has a few checkboxes with values assigned to them something like...

Select your options:

Option 1 - $100

Option 2 - $150

Option 3 - $75

When the google form is submitted (or a button is clicked) I would like to check and make sure the values selected add up to $150 or less, but not over. If they are over I would like to display a message stating "this cannot be done" or something like that.

Is this possible with App Script?

Thanks,

Keith


Solution

  • I was searching around about what you are trying to do and it seems that once the form is submitted you won't be able to trigger any message as the user will be sent to the confirmation screen, you could only change the confirmation message using the .setConfirmationMessage(message) method however this would not be applied immediately and it would be displayed next time someone submits the form again.

    Pretty much we can't conditionally set a message based on the answers placed by the user not even by placing a trigger on form submit.