SheetAPI.setCondition method is used to insert condition to the existing sheet.
Parameters[[sheetId, x1, y1, x2, y2]]which define a list of sheetId and a range of cells need to be added condition.
The condition name to be applied. Should be one of the following item: boolstyle, colorbar, colorgrad, iconset
SHEET_API.setCondition(SHEET_API_HD, [[1, 25, 3, 27, 5]], 'boolstyle', {
type:"greater",
base:"150",
style:{"cbgc":"rgb(248,105,107)","ccolor":"rgb(150,0,0)"}
});
See Number compare condition for more detail information.
SHEET_API.setCondition(SHEET_API_HD, [[1, 25, 3, 27, 5]], 'boolstyle', {
type:"include",
base:"test",
style:{"cbgc":"rgb(248,105,107)","ccolor":"rgb(150,0,0)"}
});
See String compare condition for more detail information.
SHEET_API.setCondition(SHEET_API_HD, [[1, 25, 3, 27, 5]], 'boolstyle', {
type:"date",
base: 0,
style:{"cbgc":"rgb(248,105,107)","ccolor":"rgb(150,0,0)"}
});
See Date compare condition for more detail information.
SHEET_API.setCondition(SHEET_API_HD, [[1, 25, 3, 27, 5]], 'boolstyle', {
type:"max",
base: 10,
style:{"cbgc":"rgb(248,105,107)","ccolor":"rgb(150,0,0)"}
});
See Calculate condition for more detail information.
SHEET_API.setCondition(SHEET_API_HD, [[1, 3, 3, 5, 3]], 'colorbar', {
neg: "rgb(255,127,0)",
pos: "rgb(0,128,255)"
});
See Date bar condition for more detail information.