Stay organized with collections Save and categorize content based on your preferences.
Detailed documentationgetBooleanCondition()
Retrieves the rule's BooleanCondition
information if this rule uses boolean condition criteria. Otherwise returns null
.
// Log the boolean criteria type of the first conditional format rules of a // sheet. const rule = SpreadsheetApp.getActiveSheet().getConditionalFormatRules()[0]; const booleanCondition = rule.getBooleanCondition(); if (booleanCondition != null) { Logger.log(booleanCondition.getCriteriaType()); }Return
BooleanCondition
— The boolean condition object, or null
if the rule does not use a boolean condition.
getGradientCondition()
Retrieves the rule's GradientCondition
information, if this rule uses gradient condition criteria. Otherwise returns null
.
// Log the gradient minimum color of the first conditional format rule of a // sheet. const rule = SpreadsheetApp.getActiveSheet().getConditionalFormatRules()[0]; const gradientCondition = rule.getGradientCondition(); if (gradientCondition != null) { // Assume the color has ColorType.RGB. Logger.log(gradientCondition.getMinColorObject().asRgbColor().asHexString()); }Return
GradientCondition
— The gradient condition object, or null
if the rule does not use a gradient condition.
getRanges()
Retrieves the ranges to which this conditional format rule is applied.
// Log each range of the first conditional format rule of a sheet. const rule = SpreadsheetApp.getActiveSheet().getConditionalFormatRules()[0]; const ranges = rule.getRanges(); for (let i = 0; i < ranges.length; i++) { Logger.log(ranges[i].getA1Notation()); }Return
Range[]
— The ranges to which this conditional format rule is applied.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-04 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-04 UTC."],[[["`XFrameOptionsMode` is used to control how a client-side Apps Script HTML Service output can be embedded in iframes on other websites."],["`ALLOWALL` permits any site to embed the page, demanding developer-implemented clickjacking protection, while `DEFAULT` maintains standard security with no `X-Frame-Options` header."],["If a script doesn't explicitly set a mode, Apps Script defaults to `DEFAULT`, ensuring standard security behaviors are in effect."]]],["Conditional format rules can be accessed and managed using the provided methods. New rules are created via `SpreadsheetApp.newConditionalFormatRule()`. Existing rules can be copied with `copy()`, retrieving a builder with the same settings. The `getBooleanCondition()` and `getGradientCondition()` methods fetch information based on the rule's criteria, while `getRanges()` retrieves the ranges the rule applies to. `Sheet.setConditionalFormatRules(rules)` applies rule settings to a given sheet.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4