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

Not able to add dropdown to Spreadsheet Cell using dataValidation property

Open karthi-keyan-n opened this issue 3 years ago • 1 comments

Hi Folks,

I'm trying to display dropdown for a cell in Google Sheet using Nodejs code. I have added the DataValidationRule as mentioned in https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/cells#DataValidationRule as below. But this is not throwing any exception nor working as expected.

let cell = sheet.getCell(rowNumber, cellIndex) cell.dataValidation = { condition: { type: 'ONE_OF_LIST', values: [ { userEnteredValue: 'DropdownValue1' }, { userEnteredValue: 'DropdownValue2' } ] }, inputMessage: "Choose any one from the list", showCustomUi: true } await sheet.saveUpdatedCells();

Any insights on this would be much helpful!

karthi-keyan-n avatar Apr 26 '22 06:04 karthi-keyan-n

Sorry but this is not yet supported in this module. Just setting it on the cell object like that won't actually do anything at the moment. Open to pull requests!

theoephraim avatar May 14 '22 05:05 theoephraim

combined into #566

theoephraim avatar Jun 28 '23 23:06 theoephraim