# Clear all column's data

**URL:** <https://community.glideapps.com/t/clear-all-columns-data/7837>\
**Category:** Ask for Help\
**Created:** [April 25, 2020, 9:25pm UTC](https://community.glideapps.com/t/clear-all-columns-data/7837 "2020-04-25T21:25:54Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 28, 2020, 1:19am UTC](https://community.glideapps.com/t/clear-all-columns-data/7837/4 "2020-04-28T01:19:02Z")

</div>

Here’s a handful of posts that might help. As far as the trigger, be sure to look for this icon when writing the script. This allows you to set up a trigger. Just make sure it’s an onChange trigger.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/4/4e084ac086f803e25c57a48bdbd7dab0d72fae78.png)

> [@Trigger script onEdit event from App](https://community.glideapps.com/t/trigger-script-onedit-event-from-app/6795/11):
>
> function trailerDelete(e) { //This is the onChange(e) trigger var app = SpreadsheetApp; var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var targetSheet = app.getActiveSpreadsheet().getSheetByName(“Report”); // You can replace “Report” in the above line, to the sheet that you are referencing. [//Logger.log](https://Logger.log)(targetSheet.getRange(2, 2).getValue() + " Test"); if (e.changeType==“EDIT”){ for (var i = 2; i \< 6;i++){ if (targetSheet.getRange(i,2).getValue() ==""){ targetSheet.…

> [@Reset values daily](https://community.glideapps.com/t/reset-values-daily/1457/17):
>
> The only recommendation would be to look at a bunch of script writing tutorials and write one. Then 2, then 3, etc… Then keep writing them until you are confident that it does what you want. To simply clear a few columns is pretty straight forward. If you wanted to clear the contents of columns E and F on Sheet2, this is the script. function clearAFewColumns() { var sheet = SpreadsheetApp.getActive().getSheetByName('Sheet2'); var lastRow = sheet.getLastRow(); // Column E = 5; F = 6 …

> [@Clear cell after set time](https://community.glideapps.com/t/clear-cell-after-set-time/6323/4):
>
> 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(); }

> [@Option to delete all child-items](https://community.glideapps.com/t/option-to-delete-all-child-items/94/7):
>
> When you get into the script editor one of the icons is a picture of a clock. That is where you would set up the timed trigger. I lied, the code is actually 44 lines of code but I did throw in some comments to hopefully make it easier to follow. I did use arrays as that is the fastest way to scan through data and write to a sheet in mass. So basically you would set up a trigger to run this code, maybe nightly to clean up the orphan’d children. [Here is the sheet.](https://docs.google.com/spreadsheets/d/1iFYtICaG-GqifXInAsV9zks_9vQq5g2llDeZ8xJ5X0c/edit?usp=sharing) Make a copy of it and then t…

---

_[View the full topic](https://community.glideapps.com/t/clear-all-columns-data/7837)._
