Skip to content Skip to sidebar Skip to footer

Update Single Row Formatting For Entire Sheet

I want to just apply a formatting from a JSON Entry. The first thing I did was make my desirable format on my spreadsheet for the second row of all columns. I then retrieved them w

Solution 1:

When you include fields as a part of the request, you indicate to the API endpoint that it should overwrite the specified fields in the targeted range with the information found in your uploaded resource. fields="*" correspondingly is interpreted as "This request specifies the entire data and metadata of the given range. Remove any previous data and metadata from the range and use what is supplied instead."

Thus, anything not specified in your updateCells requests will be removed from the range supplied in the request (e.g. values, formulas, data validation, etc.).

You can learn more in the guide to batchUpdate

For an updateCell request, the fields parameter is as described:

The fields of CellData that should be updated. At least one field must be specified. The root is the CellData; 'row.values.' should not be specified. A single "*" can be used as short-hand for listing every field.

If you then view the resource description of CellData, you observe the following fields:

  • "userEnteredValue"
  • "effectiveValue"
  • "formattedValue"
  • "userEnteredFormat"
  • "effectiveFormat"
  • "hyperlink"
  • "note"
  • "textFormatRuns"
  • "dataValidation"
  • "pivotTable"

Thus, the proper fields specification for your request is likely to be fields="effectiveFormat", since this is the only field you supply in your row_data property.

Consider also using the repeatCell request if you are just specifying a single format.

Post a Comment for "Update Single Row Formatting For Entire Sheet"