# Update Row — AppDrag

> Updates a row in a cloud database table. See the documentation

- Key: `appdrag-update-row`
- Type: Action (Write)
- Version: 0.0.2
- App: AppDrag (`appdrag`) — https://pipedream.com/apps/appdrag.md
- This page (HTML): https://pipedream.com/apps/appdrag/actions/update-row
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/appdrag/actions/update-row/update-row.mjs

## Description

Updates a row in a cloud database table. [See the documentation](https://support.appdrag.com/doc/Appdrag-Cloudbackend-npm)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `table` | `string` | Yes | The name of the table. Options are loaded from the connected account. |
| `columnsToUpdate` | `string[]` | Yes | The name of the columns to update in the table. Eg. ["column1", "column2"] Options are loaded from the connected account. |
| `values` | `string[]` | Yes | The values to update in the table for each Column. Eg. ["value1", "value2"] |
| `whereCondition` | `string` | Yes | In this expression you can write your own conditions (eg. column1 = ? or column2 = ?). Depending on the number of ? symbols likewise you need to add the same number of Where Values. |
| `whereValues` | `string[]` | Yes | This is the list of values that will match every ? symbol in the Where Condition expression. Eg. ["value1", "value2"] |

## 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": "appdrag",
      },
    },
  },
)

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: "appdrag-update-row",
  arguments: {
    table: "Table Name",
    columnsToUpdate: ["Columns"],
  },
})
```

**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: "appdrag-update-row",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    appdrag: { authProvisionId: "apn_xxxxxxx" },
    table: "Table Name",
    columnsToUpdate: ["Columns"],
  },
})

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": "appdrag-update-row",
    "configured_props": {
      "appdrag": { "authProvisionId": "apn_xxxxxxx" },
      "table": "Table Name",
      "columnsToUpdate": ["Columns"]
    }
  }'
```

---

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