View as Markdown
Coda icon

Coda ACTION

Upsert Rows

Creates a new row, or updates an existing row if one already matches the given keyColumns values, in a Coda table. Requires a doc ID and table ID — use the List Docs and List Tables actions to discover these. keyColumns identifies which column(s) uniquely identify a row (e.g. a name or external ID column) — use the List Columns action to look up column IDs; leave it blank to always insert a new row instead of matching an existing one. Column values are set via columnValues, a flat object mapping column ID or name to value. Use this action instead of Create Rows when a matching row might already exist and you want to avoid duplicates, or instead of Update Row when you don't already know the target row's ID. When upserting, if multiple rows match the specified key column(s), they will all be updated with the specified value. See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Coda account once, then configure and run Upsert Rows from your backend or agent.

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: "coda-upsert-rows",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    coda: { authProvisionId: "apn_xxxxxxx" },
    docId: "Doc ID",
    tableId: "Table ID",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Upsert Rows inputs
Property Type Description
docId Doc ID string
The ID of the Coda doc (e.g. AbCDeFGhij). Use the List Docs action to look up doc IDs.
Required
tableId Table ID string
The ID of the table (e.g. grid-pqRst-U). Use the List Tables action to look up table IDs for a doc.
Required
keyColumns Key Columns string[]
Column ID(s) to use as upsert keys (e.g. c-abc123) — provide one or more column IDs, not a JSON array string. Rows matching all key column values will be updated instead of a new row being created. Leave blank to always insert a new row. Use the List Columns action to look up column IDs.
Optional
disableParsing Disable Parsing boolean
If true, the API will not attempt to parse the data in any way
Optional
columnValues Column Values object
A flat object mapping column ID or name to the value to set on the row, e.g. { "c-abc123": "foo", "Status": "Done" }. Use the List Columns action to look up column IDs.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
coda-upsert-rows
Version
1.0.0
App
Coda
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes