# Coda

> Access Coda docs, tables, and rows.

App · Documents · 5 actions · 1 trigger. Web page: https://docs.lodol.com/docs/integrations/coda

## Triggers

Start a workflow when something happens in Coda. See [how triggers work](https://docs.lodol.com/docs/concepts/triggers.md).

### Coda New Row

Triggers when a new row is added to a Coda table

**Filters**: Narrow which events start a run.

- `doc_id` (required)
- `table_id` (required)

**Event fields**: What a run starts with. Later steps read each field with an @ reference.

- `id` (text)
- `name` (text)
- `doc_id` (text)
- `table_id` (text)

## Actions

### Add row

Add a new row to a Coda table.

**Inputs**

- Doc ID (`doc_id`, text, required): The ID of the Coda doc. Use the List docs action to find it.
- Table ID (`table_id`, text, required): The ID of the table. Use the List tables in a doc action to find it.
- Row values (`row_values`, object, required): Column values for the new row

**Outputs**: Response confirming the row was queued for insertion.

- `addedRowCount` (number): Number of rows added (typically 1)
- `requestId` (text): Coda request ID for tracking the mutation status

**Example output**

```json
{
  "addedRowCount": 1,
  "requestId": "abc-123-def"
}
```

### List docs

Retrieve all accessible Coda docs for the connected account.

**Inputs**: None.

**Outputs**: Response object. Access items via the 'docs' property.

- `docs` (list): Array of doc objects. Access with response.docs[index]

**Example output**

```json
[
  {
    "id": "AbCdEfGhIj",
    "name": "My Project Doc",
    "owner": "user@example.com",
    "type": "doc"
  }
]
```

### List rows

Retrieve rows from a Coda table, with an optional limit on how many to return.

**Inputs**

- Doc ID (`doc_id`, text, required): The ID of the Coda doc. Use the List docs action to find it.
- Table ID (`table_id`, text, required): The ID of the table. Use the List tables in a doc action to find it.
- Limit (`limit`, number): Maximum number of rows to return

**Outputs**: Response object. Access items via the 'rows' property.

- `rows` (list): Array of row objects. Access with response.rows[index]

**Example output**

```json
[
  {
    "id": "i-abc123",
    "name": "Task 1",
    "type": "row",
    "values": {
      "Assignee": "John",
      "Status": "In Progress"
    }
  }
]
```

### List tables in a doc

Fetch all tables for a specific Coda doc.

**Inputs**

- Doc ID (`doc_id`, text, required): The ID of the Coda doc. Use the List docs action to find it.

**Outputs**: Response object. Access items via the 'tables' property.

- `tables` (list): Array of table objects. Access with response.tables[index]

**Example output**

```json
[
  {
    "id": "grid-abc123",
    "name": "Tasks",
    "parent": {
      "id": "AbCdEfGhIj",
      "type": "doc"
    },
    "type": "table"
  }
]
```

### Update row

Update an existing row in a Coda table.

**Inputs**

- Doc ID (`doc_id`, text, required): The ID of the Coda doc. Use the List docs action to find it.
- Table ID (`table_id`, text, required): The ID of the table. Use the List tables in a doc action to find it.
- Row ID (`row_id`, text, required): The ID of the row to update. Use the List rows action to find it.
- Row values (`row_values`, object, required): Column values to update on the row

**Outputs**: Response confirming the row update was queued.

- `id` (text): The row ID that was updated
- `requestId` (text): Coda request ID for tracking the mutation status

**Example output**

```json
{
  "id": "i-abc123",
  "requestId": "abc-123-def"
}
```
