node-google-spreadsheet
node-google-spreadsheet copied to clipboard
setDataValidation data validation
Hi, can I use this package to set data validation rules for a range of cells? I've tried sheet._makeSingleUpdateRequest and sheet.setDataValidation without success. Thanks!
values =[
{userEnteredValue: 'Emeli Studs (18K Gold Vermeil)=>6552666341465'},
{userEnteredValue: 'Shilo Teeny-Tiny Hoops (24K Gold Vermeil)=>6578911641689'},
{userEnteredValue: 'Hira CZ Earrings (18K Gold Vermeil)=>6913437761625'}
];
const response = await sheet.setDataValidation({
range: {
sheetId: sheet.sheetId,
startRowIndex: row.rowNumber - 1,
endRowIndex: row.rowNumber,
startColumnIndex: ALL_PRODUCTS_COLUMN_INDEX,
endColumnIndex: ALL_PRODUCTS_COLUMN_INDEX+1,
},
rule: {
condition: {
type: "ONE_OF_LIST",
values,
},
inputMessage: "Product must match customer's order history",
strict: true,
},
});
it is not implemented but should be relatively straightforward to add. Open to PRs!