Actions40
- Create Bullets Request Actions
- Create Document Request Actions
- Create Headers & Footers Request Actions
- Create Images Request Actions
- Create Named Ranges Request Actions
- Create Tables Request Actions
- Create Tabs Request Actions
- Create Text Request Actions
- Send Request Actions
Create Text Request → Update Text Style
AI-generatedSummary
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.