update_conditional_formatting
Modify conditional formatting rules in Google Sheets spreadsheets to change cell appearance based on data conditions, updating colors, ranges, or criteria for existing rules.
Instructions
Updates an existing conditional formatting rule by index on a sheet.
Args: user_google_email (str): The user's Google email address. Required. spreadsheet_id (str): The ID of the spreadsheet. Required. range_name (Optional[str]): A1-style range to apply the updated rule (optionally with sheet name). If omitted, existing ranges are preserved. rule_index (int): Index of the rule to update (0-based). condition_type (Optional[str]): Sheets condition type. If omitted, the existing rule's type is preserved. condition_values (Optional[Union[str, List[Union[str, int, float]]]]): Values for the condition. background_color (Optional[str]): Hex background color when condition matches. text_color (Optional[str]): Hex text color when condition matches. sheet_name (Optional[str]): Sheet name to locate the rule when range_name is omitted. Defaults to first sheet. gradient_points (Optional[Union[str, List[dict]]]): If provided, updates the rule to a gradient color scale using these points.
Returns: str: Confirmation of the updated rule and the current rule state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_google_email | Yes | ||
| spreadsheet_id | Yes | ||
| rule_index | Yes | ||
| range_name | No | ||
| condition_type | No | ||
| condition_values | No | ||
| background_color | No | ||
| text_color | No | ||
| sheet_name | No | ||
| gradient_points | No |