Erase all previous data

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.

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?

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

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

Exactly

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.

1 Like

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

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 post.

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.

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

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.

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.

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ā€¦ :grin:

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.

1 Like