L2 Hub
Google
gdocs
Replace Text

L2 Construct: replace_text

docs google

Description

ReplaceTextInDocument replaces template text (e.g., {{variable}}) in a Google Docs document with provided content and returns the document ID and URL.

L2 Data

  1. Provider: google
  2. Module: gdocs
  3. Action: replace_text

Example Step

{
  "name": "insert-your-step-name",
  "type": "l2",
  "l2_data": {
    "provider": "google",
    "module": "gdocs",
    "action": "replace_text"
  }
}
 

Input

Example

{
  "document_id": "1abc123...xyz789",
  "text_replacements": {
    "company": "Acme Corp",
    "date": "2024-08-20",
    "name": "John Doe"
  }
}
 

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pontus.bpa/pkgs/l2/google/gdocs/replace-text-input",
  "$ref": "#/$defs/ReplaceTextInput",
  "$defs": {
    "ReplaceTextInput": {
      "properties": {
        "document_id": {
          "type": "string"
        },
        "text_replacements": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["document_id", "text_replacements"]
    }
  }
}
 

Output

Example

{
  "document_id": "1abc123...xyz789",
  "document_url": "https://docs.google.com/document/d/1abc123...xyz789"
}
 

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pontus.bpa/pkgs/l2/google/gdocs/replace-text-output",
  "$ref": "#/$defs/ReplaceTextOutput",
  "$defs": {
    "ReplaceTextOutput": {
      "properties": {
        "document_id": {
          "type": "string"
        },
        "document_url": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["document_id", "document_url"]
    }
  }
}