# Erase all previous data

**URL:** https://community.glideapps.com/t/erase-all-previous-data/18590
**Category:** Ask for Help
**Created:** [November 18, 2020, 1:34am UTC](https://community.glideapps.com/t/erase-all-previous-data/18590 "2020-11-18T01:34:44Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Todd\_Lichtenwalter](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/todd_lichtenwalter/32/12231_2.png) [@Todd\_Lichtenwalter](https://community.glideapps.com/u/Todd_Lichtenwalter)
#### Post date: [November 18, 2020, 1:34am UTC](https://community.glideapps.com/t/erase-all-previous-data/18590/1 "2020-11-18T01:34:44Z")

</div>

I have a graphing tab in my app. I need a way to allow the students to erase all the graph data and be able to start over. i.e. the counts of a bar chart, how can I make a button/switch to erase all the data so that they can start over fresh?

I have it so that the latest information/latest row is read, for things like the title of the graph, the labels for the categories and the number of items to be counted. Last hurdle, I hope, is how to allow them to start over with a fresh dataset.

---

<div class="post-metadata">

### Author: ![Todd\_Lichtenwalter](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/todd_lichtenwalter/32/12231_2.png) [@Todd\_Lichtenwalter](https://community.glideapps.com/u/Todd_Lichtenwalter)
#### Post date: [November 18, 2020, 2:56am UTC](https://community.glideapps.com/t/erase-all-previous-data/18590/2 "2020-11-18T02:56:37Z")

</div>

I am thinking others may have this same issue: you place a chart in your app somewhere and as it is now, they are just one use. Aside from allowing the user to edit and going back and resetting all the data entries to zero…what are others doing to get around this problem. My thinking is the Glide team should just go ahead and build into charts the user option to reset data to zero, otherwise each chart is a one use situation- no way to reuse the graph in the future, and charts are precluded from traditional science work of data entry, right?

---

<div class="post-metadata">

### Author: ![Todd\_Lichtenwalter](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/todd_lichtenwalter/32/12231_2.png) [@Todd\_Lichtenwalter](https://community.glideapps.com/u/Todd_Lichtenwalter)
#### Post date: [November 18, 2020, 3:32am UTC](https://community.glideapps.com/t/erase-all-previous-data/18590/3 "2020-11-18T03:32:10Z")

</div>

ok, I think this VBA will do the trick-- will test it out and see…

> **[VBA Macro to Delete Rows Based on Cell Values or Conditions in Excel](https://www.excelcampus.com/vba/delete-rows-cell-values/)**
>
> Learn how to use VBA macros to delete rows based on cell values or conditions in Excel. Includes sample code and video tutorial.

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [November 18, 2020, 4:26am UTC](https://community.glideapps.com/t/erase-all-previous-data/18590/4 "2020-11-18T04:26:57Z")

</div>

So you have multiple rows and want an action to delete all rows associated with the student?

---

<div class="post-metadata">

### Author: ![Todd\_Lichtenwalter](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/todd_lichtenwalter/32/12231_2.png) [@Todd\_Lichtenwalter](https://community.glideapps.com/u/Todd_Lichtenwalter)
#### Post date: [November 18, 2020, 10:33am UTC](https://community.glideapps.com/t/erase-all-previous-data/18590/5 "2020-11-18T10:33:48Z")

</div>

Exactly

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [November 18, 2020, 5:51pm UTC](https://community.glideapps.com/t/erase-all-previous-data/18590/6 "2020-11-18T17:51:35Z")

</div>

> [@ThinhDinh](#):
>
> So you have multiple rows and want an action to delete all rows associated with the student?

What I normally do in this case is to add another column and call it something like “Delete Flag”.  
When I want to delete a row (or rows), I increment that column so that it’s not empty, and then use that to filter and hide it from the user. I then have an `ON_CHANGE` trigger that fires and removes any rows that have been marked for deletion. Works quite well.

---

<div class="post-metadata">

### Author: ![Todd\_Lichtenwalter](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/todd_lichtenwalter/32/12231_2.png) [@Todd\_Lichtenwalter](https://community.glideapps.com/u/Todd_Lichtenwalter)
#### Post date: [November 18, 2020, 6:34pm UTC](https://community.glideapps.com/t/erase-all-previous-data/18590/7 "2020-11-18T18:34:22Z")

</div>

Thank you Darren, that is a very useful tip, yet in this case I want the students to be able to fire this change right then and there without my intervention. Could I use your technique for this? Like maybe have a toggle switch and every time the toggle changes it erases all the rows in the sheet containing that users email? @ThinhDinh

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [November 19, 2020, 6:42am UTC](https://community.glideapps.com/t/erase-all-previous-data/18590/8 "2020-11-19T06:42:39Z")

</div>

> [@Todd\_Lichtenwalter](#):
>
> Thank you Darren, that is a very useful tip, yet in this case I want the students to be able to fire this change right then and there without my intervention. Could I use your technique for this? Like maybe have a toggle switch and every time the toggle changes it erases all the rows in the sheet containing that users email?

Doing it for one row is easy, and can appear instant by using filter conditions to hide the row once it’s flagged.

Doing it for all rows belonging to the same user is a little trickier, but I believe it should be possible. I’m thinking that you’d need to use some combination of user specific columns with some funky rollup/ITE columns such that if one row gets flagged, then they all get flagged (and hidden). I can’t immediately think how to do this, but I “feel” like it should be possible. @ThinhDinh @Jeff_Hager any ideas?

Edit: Actually, you may be able to adapt the technique that @Robert_Petitto demonstrates in [this](https://community.glideapps.com/t/how-to-clear-an-entire-column-compound-action-trickery/18555) post.

---

<div class="post-metadata">

### Author: ![Todd\_Lichtenwalter](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/todd_lichtenwalter/32/12231_2.png) [@Todd\_Lichtenwalter](https://community.glideapps.com/u/Todd_Lichtenwalter)
#### Post date: [November 19, 2020, 12:28pm UTC](https://community.glideapps.com/t/erase-all-previous-data/18590/9 "2020-11-19T12:28:32Z")

</div>

Ok, I will check it out, thank you. Shaping up to be a nice little feature of the app- might be nice stand alone for teachers and students and anyone wanting to collect field data etc.

By the way, has anyone invented the wheel yet on how to have a user be able to export their collected data to a cvs or other file? This would allow it to serve as a hand held data collector for student to be later worked on post field work in Excel or Numbers.

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [November 19, 2020, 1:42pm UTC](https://community.glideapps.com/t/erase-all-previous-data/18590/10 "2020-11-19T13:42:59Z")

</div>

What type of file do you want to export, and how much data is there to be included?

---

<div class="post-metadata">

### Author: ![Todd\_Lichtenwalter](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/todd_lichtenwalter/32/12231_2.png) [@Todd\_Lichtenwalter](https://community.glideapps.com/u/Todd_Lichtenwalter)
#### Post date: [November 19, 2020, 2:05pm UTC](https://community.glideapps.com/t/erase-all-previous-data/18590/11 "2020-11-19T14:05:19Z")

</div>

It would be numerical data- but text also would be nice. The idea is to have it so that a student could export a range of rows of data out of Glide. In most case use scenarios this would be less than 100 rows.

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [November 19, 2020, 2:13pm UTC](https://community.glideapps.com/t/erase-all-previous-data/18590/12 "2020-11-19T14:13:30Z")

</div>

I think this is feasible but would require a complex setup. I’m thinking of using QUERY to get all data into a sheet, then a Zap to export that sheet to a XLSX/CSV.

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [November 19, 2020, 2:28pm UTC](https://community.glideapps.com/t/erase-all-previous-data/18590/13 "2020-11-19T14:28:57Z")

</div>

I think my approach would be to give them a button that’s tied to an increment action on an “Export” column in their user profile. I’d then have a script that triggers when that change is detected. The script would:

- gather all the required data for that user
- format and deliver it (email, shared doc?)
- reset the export column on the user profile

You could probably extend that to create a certain level of user customisation. ie. provide filter options such as start/end date, etc. In this case, the button could open up a form where they select their filtering options and then submit to trigger the report generation. (Keeping in mind that form submission creates new rows, so it would probably need to go to a separate sheet).

You could go even further and keep a log of all these export ‘events’, so you can see if it’s being used. I think I’ll stop here… 😁

This approach would only work if all the required data is present in your GSheets. If any of it is in Glide tables, then all bets are off.
