node-google-spreadsheet
node-google-spreadsheet copied to clipboard
Not able to add dropdown to Spreadsheet Cell using dataValidation property
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!
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!
combined into #566