Google Sheets: Checklist Template with Reset Button
The aim of this tutorial🔍 is to create a simple sheet containing a list of checkboxes and a button that resets all of them at once for the quality review
TL DR; just take and populate the template from
https://docs.google.com/spreadsheets/d/1dAcvKPKAlYSxMp9MmEsdB5AjU24c63THYOKcjl4AWgo/edit?usp=sharing
1. Checkbox reset
function ResetCheckboxesOnSheet() {
var ss=SpreadsheetApp.getActive();
var sh=ss.getActiveSheet();
var rg=sh.getDataRange();
var vA=rg.getDataValidations();
var cbA=[];
for(var i=0;i<vA.length;i++) {
for(var j=0;j<vA[i].length;j++) {
var rule=vA[i][j];
if(rule!=null) {
var criteria = rule.getCriteriaType();
if(criteria == SpreadsheetApp.DataValidationCriteria.CHECKBOX) {
sh.getRange(i+1,j+1).setValue(false) }
}
}
}
}
2. Add button
- Add button as per Google Sheets Button: Run Apps Script With A Single Click
