# Insert Date — Google Docs

> Insert a date smart chip into a Google Doc: a real date chip readers can click, not typed text. Use it for due dates, meeting dates, deadlines and timelines. Pass a calendar date (2026-11-14), or a date and time plus Time Zone to show the…

- Key: `google_docs-insert-date`
- Type: Action (Write)
- Version: 0.1.0
- App: Google Docs (`google_docs`) — https://pipedream.com/apps/google-docs.md
- This page (HTML): https://pipedream.com/apps/google-docs/actions/insert-date
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/google_docs/actions/insert-date/insert-date.mjs

## Description

Insert a date smart chip into a Google Doc: a real date chip readers can click, not typed text. Use it for due dates, meeting dates, deadlines and timelines. Pass a calendar date (`2026-11-14`), or a date and time plus **Time Zone** to show the time as well (`2026-11-14T15:00` with `America/New_York` -> `Nov 14, 2026 3:00 PM EST`). Place the chip with **Placeholder** (replace text such as `{{due}}` that you wrote with **Insert Text**) or with **Position**; in a multi-tab document either set **Tab ID** (from **List Tabs**) or use **Placeholder**. Use **Find Document** to resolve a document's name to its ID. Example: call with documentId=`1AbC...`, date=`2026-11-14`, placeholder=`{{due}}` -> a chip reading `Nov 14, 2026`; returns `chipsInserted`, each chip's `tabId` and `index`, and the document `url`. [See the documentation](https://developers.google.com/workspace/docs/api/reference/rest/v1/documents/request#InsertDateRequest)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `documentId` | `string` | Yes | The ID of the Google Doc. This is the long string in the document's URL: https://docs.google.com/document/d/{DOCUMENT_ID}/edit. Use Find Document to resolve a document's name to its ID. |
| `date` | `string` | Yes | The date as YYYY-MM-DD (e.g. 2026-11-14), or a date and local time as YYYY-MM-DDTHH:MM (e.g. 2026-11-14T15:00) to show a time too. A time needs Time Zone. A trailing Z or offset (2026-11-14T20:00:00Z) is read as that exact instant and shown in Time Zone. |
| `timeZone` | `string` | No | IANA time zone for a Date that includes a time, e.g. America/New_York or Europe/London. Required when there is a time; the chip shows the time with the zone's abbreviation. Ignored for a date without a time. |
| `dateFormat` | `string` | No | How the chip displays the date: month_day_year -> Nov 14, 2026 (default), month_day -> Nov 14, month_day_full -> November 14, iso -> 2026-11-14. |
| `placeholder` | `string` | No | Existing text to replace with the chip, matched exactly (case-sensitive). Typically a placeholder you wrote with Insert Text, such as {{owner}}, or a name already in the document. Searches every tab unless Tab ID is set. When set, Position is ignored. This is the reliable way to put a chip mid-sentence: no character index needed. |
| `occurrence` | `string` | No | Which matches of Placeholder become chips: all (default) or first. |
| `position` | `string` | No | Where to insert the chip when no Placeholder is given: end to append to the end of the tab (default), beginning, or a numeric character index (e.g. 12) from Get Document. The chip joins the paragraph at that point, so to start a new line insert a newline with Insert Text first. |
| `tabId` | `string` | No | For a multi-tab document, the ID of the tab to insert into (e.g. t.0); get IDs from List Tabs, or use the ID returned by Create Tab. Required when the document has more than one tab and the chip is placed by Position: the tool will not guess, so a chip never lands in the first tab by accident. With Placeholder, omit it to search every tab. |
| `suggestMode` | `boolean` | No | Make the change as a suggestion (Google Docs Suggesting mode) that the document's editors can accept or reject, instead of editing the document directly. The response's suggestionIds lists the suggestions the change created or extended - an edit next to an existing suggestion can join it rather than create a new one. Pass the IDs to Resolve Suggestions, or use List Suggestions to see every open suggestion. While a suggestion is open, the document text this returns shows the suggested and the original text side by side. Set true to propose the edit, or leave false (default) to edit directly. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "google_docs",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "google_docs-insert-date",
  arguments: {
    documentId: "Document ID",
    date: "Date",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "google_docs-insert-date",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    google_docs: { authProvisionId: "apn_xxxxxxx" },
    documentId: "Document ID",
    date: "Date",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "google_docs-insert-date",
    "configured_props": {
      "google_docs": { "authProvisionId": "apn_xxxxxxx" },
      "documentId": "Document ID",
      "date": "Date"
    }
  }'
```

---

- App: https://pipedream.com/apps/google-docs.md · All apps: https://pipedream.com/apps
