Google Docs Batch Update icon

Google Docs Batch Update

Build and send Google Docs batch update requests

Create Text Request → Update Text Style

AI-generated

Summary

Generates an updateTextStyle request object to apply formatting styles to a specific range of text within a Google Document.

Inputs

  • startIndex (required) — Zero-based UTF-16 start index of the text range relative to the segment.
  • endIndex (required) — Zero-based UTF-16 end index of the text range relative to the segment.
  • fields — The specific text style properties to be updated in the field mask.
  • style — Collection of styling rules to apply, including colors, font size, bold, italic, links, and font family.
  • additionalLocationFields — Additional location identifiers such as segmentId (for headers, footers, or footnotes) or tabId.

Output shape

a Google Docs batchUpdate request object

Returns an updateTextStyle request payload that can be passed to a Google Docs API batchUpdate execution step.

Examples

Example 1: Bold and resize text at the beginning of a document

Set Start Index to 0, End Index to 20, select Bold and Font Size under Fields, and set Bold = true and Font Size = 14 under Style.

Example 2: Add a hyperlink to a text range in a header

Set Start Index to 5, End Index to 15, set Segment ID in Additional Location Fields, select Link under Fields, and specify the URL under Style Link Options.

Links

Discussion