update_conditional_formatting
Update an existing conditional formatting rule in Google Sheets by specifying its index. Modify conditions, colors, or switch to gradient scale.
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. dry_run (bool): When True (default), return planned update details without mutating the sheet.
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 | ||
| dry_run | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |