HOW TO DISPLAY ALERT MESSAGE USING TIME BASED TRIGGERS

998 views
Skip to first unread message

chen malazarte

unread,
Jun 21, 2021, 10:06:08 PM6/21/21
to Google Apps Script Community
Hello, any idea or samples on how to display alert message on Google Forms or Google sheets using time based triggers

Alan Wells

unread,
Jun 21, 2021, 10:17:50 PM6/21/21
to Google Apps Script Community
Maybe toast?
Obviously the Sheet would need to be open.  Toast has 3 options for using it's 3 parameters.
The title, and timeout are optional.
You can't get anything to display in a Google Form.  Maybe you are creating a timer for something like timed test taking for students?
If you are thinking of creating an addon, an addon has restrictions on triggers.  You can't create a time trigger more than once every hour.
And a Google Form can't save the answers before the Form is submitted, so the person with the open Form must either submit the Form, or loose all the answers they entered.

chen malazarte

unread,
Jun 21, 2021, 10:26:58 PM6/21/21
to Google Apps Script Community
I want to display an alert message in my  Google forms if my time-based triggers already finished running. Is it possible? and How?
By the way, I added the scripts on the Google Form Script Editor

Alan Wells

unread,
Jun 21, 2021, 10:34:26 PM6/21/21
to Google Apps Script Community
Google Forms doesn't have the capability to display anything to the user in input mode.  And you wouldn't want to have the user to open the Form in edit mode.  So, what you want to do isn't possible.  There are services that duplicate the look of a Google Form, but they aren't really Google Forms, they are a "look alike" hosted on someone's server.  What you want to do is something that many people have wanted to do for years but Google has not provided a way to do it.  And you can't pay for something extra.  It's the free business model failure that will eventually be a serious issue for Google.

chen malazarte

unread,
Jun 21, 2021, 10:39:03 PM6/21/21
to Google Apps Script Community
It's not that I want to display the alert message during user input or answering the questions. The scenario is I wanted to display the alert message during the creation of Google forms questions screen wherein the admin who creates the google form can only see the alert message on Google forms edit screen.

Alan Wells

unread,
Jun 22, 2021, 11:24:17 AM6/22/21
to Google Apps Script Community
You can easily display a dialog box, but if you want the dialog box to fill the window, you'd need to get the size of the device window, and fit the dialog box to those dimensions.  And I don't think that you can prevent the user from closing the dialog box, so in that sense, you can't prevent the user from accessing the Form in edit mode.   But, you might be able to open a dialog box, use the DOM to get the device window width and height, then close the dialog box and open another one that fills the screen.   I suppose if you opened the Form from a Sheet, then you could get the screen dimensions from a dialog box in the Sheet, and then store them in User Properties so that when the Form opened it could get the screen dimensions from User Properties and open a dialog box from an "On Open" trigger.  
Reply all
Reply to author
Forward
0 new messages