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 a 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. See Insert Inline Image in Guidance for Google Docs connector.

Dropdown

TRUE

Input

Field Definition Type Required

Document

ID

Unique ID of the document.

Text

TRUE

Update

Find

Text to be replaced.

This field appears when you select Find and Replace for the Operation Type option.

Text

TRUE

Replace With

Text that replaces what is provided in the Find input.

When this field is empty or cleared, the Text To Replace field is deleted from the document.

This field appears when you select Find and Replace for the Operation Type option.

Text

FALSE

Match Case?

Select True if the search should use capitals and lowercase. Otherwise, set to False.

This field appears when you select Find and Replace for the Operation Type option.

True/False

FALSE

Text

Text to insert into the document.

See Text in Guidance for Google Docs connector.

This field appears when you select Insert Text for the Operation Type option.

Text

TRUE

Index

A zero-based index, in UTF-16 code units.

The index value is relative to the beginning of the segment specified by the Segment ID value. If you use this value without the Segment ID input, the body and the text are set to body.

See Index in Guidance for Google Docs connector.

This field appears when you select Insert Text or Insert Inline Image for the Operation Type option.

Text

FALSE

Start Index

The 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. You can retrieve the start and end indexes using the Read Document card.

For a specific segment (header, footer, footnotes), use the End Index as the length of the line.

The starting index is always 0.

This field appears when you select Update Text Style, Create Paragraph Bullets, or Update Paragraph Style for the Operation Type option.

Text

TRUE

End Index

The 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. You can retrieve the start and end indexes using the Read Document card.

For a specific segment (header, footer, footnotes), use the End Index as the length of the line.

The starting index is always 0.

This field appears when you select Update Text Style, Create Paragraph Bullets, or Update Paragraph Style for the Operation Type option.

Text

TRUE

Segment ID

The ID for where the header, footer, or footnote is located.

An empty Segment ID value uses the ID of the document's body.

If this field is provided, but the Index field is empty, the location used is at the end of the body, header, footer, or footnote. Otherwise, the location is immediately before the last newline in the document segment.

See Segment ID in Guidance for Google Docs connector.

This field appears when you select Update Text Style, Create Paragraph Bullets, Update Paragraph Style, or Insert Inline Image for the Operation Type option.

Text

FALSE

Reset To Default?

Select True if the selected inputs should be set to the default values. Otherwise, set to False.

To update inputs to the default values, select them as input fields.

The following fields can't be set to the default value and are ignored:

  • Font Weight

  • Link

  • Link Type

This field appears when you select Update Text Style or Update Paragraph Style for the Operation Type option.

True/False

FALSE

Bold

Select True to render the text as bold. Otherwise, set to False.

This field appears when you select Update Text Style for the Operation Type option.

True/False

FALSE

Italic

Select True to render the text as italics. Otherwise, set to False.

This field appears when you select Update Text Style for the Operation Type option.

True/False

FALSE

Underline

Select True to render the text as underlined. Otherwise, set to False.

This field appears when you select Update Text Style for the Operation Type option.

True/False

FALSE

Strikethrough

Select True to render the text as struck through. Otherwise, set to False.

This field appears when you select Update Text Style for the Operation Type option.

True/False

FALSE

Small Caps

Select True to render the text using small capital letters. Otherwise, set to False.

This field appears when you select Update Text Style for the Operation Type option.

True/False

FALSE

Background Color

Background color for the text.

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

This field appears when you select Update Text Style for the Operation Type option.

Text

FALSE

Foreground Color

Foreground color for the text.

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

This field appears when you select Update Text Style for the Operation Type option.

Text

FALSE

Font Size

Font size for the text.

The measurement units are in points, equivalent to 1/72 of an inch.

The default size is 11.

This field appears when you select Update Text Style for the Operation Type option.

Text

FALSE

Font Family

Font family of the text.

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

The default font is Arial.

This field appears when you select Update Text Style for the Operation Type option.

Dropdown

FALSE

Font Weight

Weight of the font.

This field can be any value that is a multiple of 100, from 100 through 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 the card returns an error.

See Font Weight in Guidance for Google Docs connector.

This field appears when you select Update Text Style for the Operation Type option.

Dropdown

FALSE

Baseline Offset

Vertical offset of the text 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 offset vertically upwards (superscript).
  • Subscript: The text is offset vertically downwards (subscript).

This field appears when you select Update Text Style for the Operation Type option.

Dropdown

FALSE

Link

A reference to another portion of a document or an external URL resource.

If this field is populated, you must include the Link Type field.

This field appears when you select Update Text Style for the Operation Type option.

Dropdown

FALSE

Link Type

The type of link to reference:

  • 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, you must include the Link field.

This field appears when you select Update Text Style for the Operation Type option.

Dropdown

FALSE

Create Paragraph Bullets

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

Bullet Glyph Preset

Type of bullet glyphs to use.

  • 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

This field appears when you select Update Text Style for the Operation Type option.

Dropdown

TRUE

Named Style Type

Named style type for the paragraph.

  • Normal Text
  • Title
  • Subtitle
  • Heading 1
  • Heading 2
  • Heading 3
  • Heading 4
  • Heading 5
  • Heading 6

This field appears when you select Update Paragraph Style for the Operation Type option.

Dropdown

FALSE

Text Alignment

Text alignment for the paragraph.

  • Inherited: The alignment is inherited from the parent.

  • Start

  • Center

  • End

  • Justified

This field appears when you select Update Paragraph Style for the Operation Type option.

Dropdown

FALSE

Line Spacing

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

Text

FALSE

Text Direction

Text direction of the paragraph.

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

  • Left to right
  • Right to left

This field appears when you select Update Paragraph Style for the Operation Type option.

Dropdown

FALSE

Spacing Mode

Spacing mode for the paragraph.

  • Inherited: The alignment is inherited from the parent.
  • Never collapse: Paragraph spacing is always rendered.
  • Collapse lists: Paragraph spacing is skipped between list elements.

This field appears when you select Update Paragraph Style for the Operation Type option.

Dropdown

FALSE

Space Above

Amount of extra space above the paragraph.

If this value isn't set, it inherits the value from the parent.

The measurement units are in points, equivalent to 1/72 of an inch.

This field appears when you select Update Paragraph Style for the Operation Type option.

Text

FALSE

Space Below

Amount of extra space below the paragraph.

If this value isn't set, it inherits the value from the parent.

The measurement units are in points, equivalent to 1/72 of an inch.

This field appears when you select Update Paragraph Style for the Operation Type option.

Text

FALSE

First Line Indentation

Amount of indentation for the first line of the paragraph.

If this value isn't set, it inherits the value from the parent.

The measurement units are in points, equivalent to 1/72 of an inch.

This field appears when you select Update Paragraph Style for the Operation Type option.

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 this value isn't set, it inherits the value from the parent.

The measurement units are in points, equivalent to 1/72 of an inch.

This field appears when you select Update Paragraph Style for the Operation Type option.

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 this value isn't set, it inherits the value from the parent.

The measurement units are in points, equivalent to 1/72 of an inch.

This field appears when you select Update Paragraph Style for the Operation Type option.

Text

FALSE

Keep Lines Together?

Select True if all lines of the paragraph should be laid out on the same page or column if possible. Otherwise, set to False.

If this value isn't set, it inherits the value from the parent.

This field appears when you select Update Paragraph Style for the Operation Type option.

True/False

FALSE

Keep With Next?

Select 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, set to False.

If this value isn't set, it inherits the value from the parent.

This field appears when you select Update Paragraph Style for the Operation Type option.

True/False

FALSE

Shading

Shading color for the paragraph.

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

This field appears when you select Update Paragraph Style for the Operation Type option.

Text

FALSE

Image URL

An image Uniform Resource Indicator (URI). The image is fetched at insertion time and a copy is stored for display inside the document.

Images must be less than 50 MB, can't exceed 25 megapixels, and must be in PNG, JPEG, or GIF format.

The length of the provided URI can't exceed 2 KB. The URI is saved with the image and exposed through the ImageProperties.content_uri field.

This field appears when you select Insert Inline Image for the Operation Type option.

Text

TRUE

Image Height

Height of the image.

The measurement units are in points, equivalent to 1/72 of an inch.

See Image Height in Guidance for Google Docs connector.

This field appears when you select Insert Inline Image for the Operation Type option.

Text

FALSE

Image Width

Width of the image.

The measurement units are in points, equivalent to 1/72 of an inch.

See Image Width in Guidance for Google Docs connector.

This field appears when you select Insert Inline Image for the Operation Type option.

Text

FALSE

Write Control

Revision ID

Unique ID of the revision.

Text

FALSE

Revision Type

Choose the revision type:

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

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

  • Target: Optional target revision ID of the document to which the write request is applied.

    If collaborator changes have occurred after the document was read using the API, then any 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 this change request, and the Google Docs server resolves any conflicting changes. When using a target revision ID, the API client acts 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 error. Try the request 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 may be shorter.

Dropdown

FALSE

Output

Field Definition Type

Result

Required Revision ID

The revision ID of the document.

Use the revision ID in update requests to specify which revision of a document to apply updates to and how the request should behave if the document was edited since that revision.

This field appears when you select Insert Text, Update Text Style, Create Paragraph Bullets, or Update Paragraph Style for the Operation Type option.

Text

Occurrences Changed

The number of patterns changed by the card.

This field appears when you select Find and Replace for the Operation Type option.

Number

Inline Image Object ID

The ID of the inserted image object.

This field appears when you select Insert Inline Image for the Operation Type option.

Text

Related topics

Google Docs connector

Cards in flows

Google Docs API Documentation