node-google-spreadsheet icon indicating copy to clipboard operation
node-google-spreadsheet copied to clipboard

Is it possible to format cells as verification checkboxes?

Open luiscuriel opened this issue 3 years ago • 1 comments

Is there any code to format cells as verification checkboxes with this lib? Thanks!!!

luiscuriel avatar Aug 01 '21 15:08 luiscuriel

AutoResponse: Yes it is, please merge this code as a method of the sheet:

  async setVerificationBoxes(rowstart, rowend, columnstart, columnend) {
    const requests = 
            {
                'repeatCell':
                    {
                        'cell': {'dataValidation': {'condition': {'type': 'BOOLEAN'}}},
                        'range': {'sheetId': this.sheetId, 'startRowIndex': rowstart, 'endRowIndex': rowend,
                                  'startColumnIndex': columnstart,
                                  'endColumnIndex': columnend},
                        'fields': 'dataValidation'
                    }
            };
    await this._spreadsheet._makeBatchUpdateRequest(requests, null);
  } 

luiscuriel avatar Aug 24 '21 08:08 luiscuriel