Clearing tables quickly and easily

Intro

Ever find yourself just wanting to clear all the data in a table, but find the old “select all the columns and rows and then delete” process a bit annoying?
Well, luckily for you - dashdash has a very simple solution for you. And that’s just what you’ll learn today.

Clearing tables with OVERWRITE()

If you’ve read our tutorial series on automation in dashdash, in part three you learnt that the OVERWRITE() function always rewrites the entire table.
Well, the cool thing is that you can also tell it to overwrite a table with blank cells. It’s just that easy.

For example, say you have a log that you’d like to clear automatically every so often (or even manually).
Then all you need to do is use OVERWRITE() and just make sure that its parameters are set up this way:

  • source_header is a range of blank cells
  • data is a range of blank cells
  • destination is the header range of your table (don’t worry, OVERWRITE() won’t clear this row)

Now, depending on what you want, you can trigger the function automatically using one of our scheduling functions, or maybe just use a button combined with an if statement.

Have a look at our checkbox tutorial if you’d like to see a practical application where we send an email with the logs every day, and then clear the log to make sure we only have ones sent from one day at a time.

Until next time, keep building :rocket:!

1 Like