Clear cell after set time

I have a cell which I can only run on the spreadsheet due to its operator =(MRound(((H2*128)/2500),0.5)) which clears via script & trigger when the form is submitted (on change/insert row).
Issue I’m having is, if a user does not follow through with the form submit the calculation stays in place and the next user sees it.
I would like to clear the cell after a set time (1 minute?)
How?

Add a time trigger to your script rather than just a form input trigger

This is the trigger I added, doesn’t clear the cell:
image
Something else I need to do?

This is the script I use:

function clearRange() {
   //replace 'Sheet1' with your actual sheet name
   //replace 'Range' with the range you want to clear
   var sheet = SpreadsheetApp.getActive().getSheetByName('Sheet1);
   sheet.getRange('Range').clearContent();
}

So I can run this in conjunction with my other script and trigger?

And thank you for your help on this.

Pretty sure…just add this function to your other one and create a second trigger.

It clears the cell on the Drive spreadsheet but not the Glide Data sheet.

If there hasn’t been any other edits to the sheet, then Glide won’t recognize it…you’re right.

So out of luck?

Is your app a public app or private with email?

Private with email

Pro apps can be set to automatically sync with the google sheet every few minutes. Otherwise, the cleared fields would eventually sync up to glide once you perform some other edit to data in the app.

Thank you.

1 Like