Update Document

Update a specific document in Google Docs.

Options

Field Definition Type Required
Operation Type

Choose one of the following methods:

  • Find and Replace: Replace existing text in document with new text.

  • Insert Text: Insert text into a document.

  • Update Text Style: Update a text style in a document.

  • Create Paragraph Bullets: Create paragraph bullets in a document.

  • Update Paragraph Style: Update a paragraph in a document

  • Insert Inline Image: Insert an inline image in a document.

Dropdown

TRUE

Input

v
Field Definition Type Required

Document

ID

Unique ID of the document.

Text

TRUE

Update

Find

Text to be replaced.

Appears when Find and Replace is selected from Operation Type Options.

Text

TRUE

Replace With

Text that is set as a new value. When this field is empty or unselected, the Text To Replace field is deleted from the document.

Appears when Find and Replace is selected from Operation Type Options.

Text

FALSE

Match Case?

True indicates whether the search uses capitals and lowercase. Otherwise, False.

Appears when Find and Replace is selected from Operation Type Options.

True/False

FALSE

Text

Text to insert into the document. See Guidance for Google Docs connector.

Appears when Insert Text is selected from Operation Type Options.

Text

TRUE

Index

Zero-based index, in UTF-16 code units. The index is relative to the beginning of the segment specified by Segment ID value. If used without the Segment ID input, the body and the text is set to body. See Guidance for Google Docs connector.

Appears when Insert Text or Insert Inline Image are selected from Operation Type Options.

Text

FALSE

Start Index

Zero-based start index of this range. For the document body use index values in the Start Index and End Index properties. They represent the index of the first character in the line and the last character respectively. The start and end indexes are retrieved using the Read Document card. For the specific segment (header, footer, footnotes) use the End Index as the length of the line. The starting index always is 0.

Appears when Update Test Style or Create Paragraph Bullets or Update Paragraph Style are selected from Operation Type Options.

Text

TRUE

End Index

Zero-based end index of this range, exclusive. For the document body use index values in the Start Index and End Index properties. They represent the index of the first character in the line and the last character respectively. The start and end indexes are retrieved using the Read Document card. For the specific segment (header, footer, footnotes) use the End Index as the length of the line. The starting index is always 0.

Appears when Update Test Style or Create Paragraph Bullets or Update Paragraph Style are selected from Operation Type Options.

Text

TRUE

Segment ID

ID of the header, footer or footnote the location is in. An empty Segment ID signifies the ID of the document's body. If provided without the Index field, the location used is at the end of a body, header, footer or footnote. Otherwise the location is immediately before the last newline in the document segment. See Guidance for Google Docs connector.

Appears when Update Test Style or Create Paragraph Bullets or Update Paragraph Style or Insert Inline Image are selected from Operation Type Options.

Text

FALSE

Reset To Default?

True indicates if the selected inputs to the default values. Otherwise, False. To update the inputs to the default values, select them as an input field. The following fields can't be set to default value and are ignored:

  • Font Weight

  • Link

  • Link Type

Appears when Update Test Style or Update Paragraph Style are selected from Operation Type Options.

True/False

FALSE

Bold

True indicates if the text rendered as bold. Otherwise, False.

Appears when Update Test Style is selected from Operation Type Options.

True/False

FALSE

Italic

True indicates if the text rendered as italics. Otherwise, False.

Appears when Update Test Style is selected from Operation Type Options.

True/False

FALSE

Underline

True indicates if the text is underlined. Otherwise, False.

Appears when Update Test Style is selected from Operation Type Options.

True/False

FALSE

Strikethrough

True indicates if the text rendered as struck through. Otherwise, False.

Appears when Update Test Style is selected from Operation Type Options.

True/False

FALSE

Small Caps

True indicates if the text rendered in small capital letters. Otherwise, False.

Appears when Update Test Style is selected from Operation Type Options.

True/False

FALSE

Background Color

RGB or HEX color value. Format of the value for each color is one of the following formats:

RGB: 255,10,34

HEX: #ff00d3 or #fff

Appears when Update Test Style is selected from Operation Type Options.

Text

FALSE

Foreground Color

RGB or HEX color value. Format of the value for each color should be one of the following formats:

RGB: 255,10,34

HEX: #ff00d3 or #fff

Appears when Update Test Style is selected from Operation Type Options.

Text

FALSE

Font Size

Size of the text's font. Units of measurement are a point, 1/72 of an inch.

Default size is 11.

Appears when Update Test Style is selected from Operation Type Options.

Text

FALSE

Font Family

Font family of the text. Any font from the Font menu in Google Docs or from Google Fonts is acceptable.

Default font is Arial.

Appears when Update Test Style is selected from Operation Type Options.

Dropdown

FALSE

Font Weight

Weight of the font. This field can have any value that is a multiple of 100 between 100 and 900, inclusive. This range corresponds to the numerical values described in the CSS 2.1 Specification, section 15.6, with non-numerical values disallowed. The default value is 400 ("normal").

This field must be used with the Font Family field or an error is returned.

See Guidance for Google Docs connector.

Appears when Update Test Style is selected from Operation Type Options.

Dropdown

FALSE

Baseline Offset

Ways in which text can be vertically offset from its normal position.

  • Unspecified: The text's baseline offset is inherited from the parent.

  • None: The text isn't vertically offset.

  • Superscript: The text is vertically offset upwards (superscript).

  • Subscript: The text is vertically offset downwards (subscript).

Appears when Update Test Style is selected from Operation Type Options.

Dropdown

FALSE

Link

Reference to another portion of a document or an external URL resource. If this field is populated, the Link Type field must be used.

Appears when Update Test Style is selected from Operation Type Options.

Dropdown

FALSE

Link Type
  • External URL: An external URL.
  • Bookmark ID: The ID of a bookmark in this document.
  • Heading ID: The ID of a heading in this document.

If this field is populated, the Link field must be used.

Appears when Update Test Style is selected from Operation Type Options.

Dropdown

FALSE

Create Paragraph Bullets

The following fields are related to the Create Paragraph Bullets option.

Bullet Glyph Preset

Type of bullet glyphs used:

  • Disc - Circle - Square

  • DiamondX - Arrow3D - Square

  • Checkbox

  • Arrow - Diamond - Disc

  • Star - Circle - Square

  • Arrow3D - Circle - Square

  • LeftTriangle - Diamond - Disc

  • DiamondX - HollowDiamond - Square

  • Diamond - Circle - Square

  • Decimal - Alpha - Roman

  • Parenthesis - Decimal - Alpha - Roman

  • Numbered - Decimal - Nested

  • UpperAlpha - Alpha - Roman

  • UpperRoman - UpperAlpha - Decimal

  • ZeroDecimal - Alpha - Roman

Appears when Update Test Style is selected from Operation Type Options.

Dropdown

TRUE

Named Style Type

Named style type of the paragraph.

Normal Text

Title

Subtitle

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5

Heading 6

Appears when Update Paragraph Style is selected from Operation Type Options.

Dropdown

FALSE

Text Alignment

Text alignment for this paragraph.

  • Inherited: The paragraph alignment is inherited from the parent.

  • Start

  • Center

  • End

  • Justified

Appears when Update Paragraph Style is selected from Operation Type Options.

Dropdown

FALSE

Line Spacing

Amount of space between lines, as a percentage of normal, where normal is represented as 100.

Text

FALSE

Text Direction

Text direction of this paragraph. If not set, the value defaults to Left to right because paragraph direction isn't inherited.

  • Left to right

  • Right to left

Appears when Update Paragraph Style is selected from Operation Type Options.

Dropdown

FALSE

Spacing Mode

Spacing mode for the paragraph.

  • Inherited

  • Never collapse: Paragraph spacing is always rendered.

  • Collapse lists: Paragraph spacing is skipped between list elements.

Appears when Update Paragraph Style is selected from Operation Type Options.

Dropdown

FALSE

Space Above

Amount of extra space above the paragraph. If not set, the value is inherited from the parent. Units of measurement are a point, 1/72 of an inch.

Appears when Update Paragraph Style is selected from Operation Type Options.

Text

FALSE

Space Below

Amount of extra space below the paragraph. If not set, the value is inherited from the parent. Units of measurement are a point, 1/72 of an inch.

Appears when Update Paragraph Style is selected from Operation Type Options.

Text

FALSE

First Line Indentation

Amount of indentation for the first line of the paragraph. If not set, the value is inherited from the parent. Units of measurement are a point, 1/72 of an inch.

Appears when Update Paragraph Style is selected from Operation Type Options.

Text

FALSE

Start Indentation

Amount of indentation for the paragraph on the side that corresponds to the start of the text, based on the current paragraph direction. If not set, the value is inherited from the parent. Units of measurement are a point, 1/72 of an inch.

Appears when Update Paragraph Style is selected from Operation Type Options.

Text

FALSE

End Indentation

Amount of indentation for the paragraph on the side that corresponds to the end of the text, based on the current paragraph direction. If not set, the value is inherited from the parent. Units of measurement are a point, 1/72 of an inch.

Appears when Update Paragraph Style is selected from Operation Type Options.

Text

FALSE

Keep Lines Together?

True if all lines of the paragraph should be laid out on the same page or column if possible. Otherwise, False. If not set, the value is inherited from the parent.

Appears when Update Paragraph Style is selected from Operation Type Options.

True/False

FALSE

Keep With Next?

True if at least a part of this paragraph should be laid out on the same page or column as the next paragraph if possible. Otherwise, False. If not set, the value is inherited from the parent.

Appears when Update Paragraph Style is selected from Operation Type Options.

True/False

FALSE

Shading

RGB or HEX color value. Format of the value for each color should be one of the following formats:

RGB: 255,10,34

HEX: #ff00d3 or #fff

Appears when Update Paragraph Style is selected from Operation Type Options.

Text

FALSE

Image URL

Image URI. The image is fetched at insertion time and a copy is stored for display inside the document. Images must be less than 50MB in size, can't exceed 25 megapixels, and must be in PNG, JPEG, or GIF format. The provided URI can be at most 2 kB in length. The URI is saved with the image and exposed through the ImageProperties.content_uri field.

Appears when Insert Inline Image is selected from Operation Type Options.

Text

TRUE

Image Height

Height of the image. Units of measurement are a point, 1/72 of an inch. See Guidance for Google Docs connector.

Appears when Insert Inline Image is selected from Operation Type Options.

Text

FALSE

Image Width

Width of the image. Units of measurement are a point, 1/72 of an inch. See Guidance for Google Docs connector.

Appears when Insert Inline Image is selected from Operation Type Options.

Text

Write Control

Revision ID

Unique ID of the revision.

Text

FALSE

Revision Type

Choose the revision type:

Required: Optional revision ID of the document the write request is applied to. If this isn't the latest revision of the document, the request isn't processed and returns a 400 bad request error.

When a required revision ID is returned in a response, it indicates the revision ID of the document after the request was applied.

Target: optional target revision ID of the document the write request is applied to.

If collaborator changes have occurred after the document was read using the API, the changes produced by this write request are applied against the collaborator changes. This results in a new revision of the document that incorporates both the collaborator changes and the changes in the request, with the Docs server resolving conflicting changes. When using target revision ID, the API client can be thought of as another collaborator of the document.

The target revision ID can only be used to write to recent versions of a document. If the target revision is too far behind the latest revision, the request isn't processed and returns a 400 bad request error. The request should be tried again after retrieving the latest version of the document. Usually a revision ID remains valid for use as a target revision for several minutes after it's read, but for frequently edited documents this window might be shorter.

Dropdown

FALSE

Output

Field Definition Type

Result

Required Revision ID

Revision ID of the document. Can be used in update requests to specify which revision of a document to apply updates to and how the request should behave if the document has been edited since that revision.

Appears when Insert Text or Update Text Style or Create Paragraph Bullets or Update Paragraph Style are selected from Operation Type Options.

Text

Occurrences Changed

Number of changed patterns.

Appears when Find and Replace is selected from Operation Type in Options.

Number

Inline Image Object ID

ID of the inserted image object.

Appears when Insert Inline Image is selected in the Operation Type option.

Text

Related topics

Google Docs connector

Workflow elements

Guidance for Google Docs connector

Google Docs API Documentation