set range background color google script multiple colors
const myColorFunction = ({
sheetName = "Form Responses 1",
targetValue = "Open"
} = {}) => {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName(sheetName);
const rng = sheet.getDataRange();
const numHeaders = 1;
const backgrounds = rng.getBackgrounds();
const fontColors = rng.getFontColors();
const newBckgs = backgrounds.map((row) => {
const [firstCell] = row;
if (firstCell === targetValue) {
row[5] = "red";
}
return row;
});
const newColors = fontColors.map((row) => {
const [firstCell] = row;
if (firstCell === targetValue) {
row[5] = "white";
}
return row;
});
rng.setBackgrounds(newBckgs);
rng.setFontColors(newColors);
}
Also in JavaScript:
- js go to see history
- install node js in manjaro
- js queryselector radio checked
- react dark mode npm
- javascript encode url to decode C#
- javascript location href redirect
- three js get size of object
- create new vuejs project
- res object anatomy nodejs
- javascript get class name
- javascript axios request with params for client side rendering
- jquery get element innertext
- jquery select specific radio button by value
- edit onclick event
- javascript find element in array and remove
- how to create component in reactjs
- display console log in HTML
- badlion client
- node command get to much time
- bot prefix discord.js
- discord.js message on member add
- compare string camelcase and lowercase javascript
- ejs if else
- how to send array to js file in wplms