# Find or Create Feedback — ProdPad

> Finds or creates a feedback. See the docs for find feedback and create feedback.

- Key: `prodpad-find-or-create-feedback`
- Type: Action (Read-only)
- Version: 0.0.3
- App: ProdPad (`prodpad`) — https://pipedream.com/apps/prodpad.md
- This page (HTML): https://pipedream.com/apps/prodpad/actions/find-or-create-feedback
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/prodpad/actions/find-or-create-feedback/find-or-create-feedback.mjs

## Description

Finds or creates a feedback. See the docs for [find feedback](https://app.swaggerhub.com/apis-docs/ProdPad/prodpad/1.0#/Feedback/GetFeedbacks) and [create feedback](https://app.swaggerhub.com/apis-docs/ProdPad/prodpad/1.0#/Feedback/PostFeedbacks).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `customer` | `string` | No | ID of the contact providing the feedback. Options are loaded from the connected account. |
| `company` | `string` | No | Set to filter the feedback results based on whether the feedback was entered for a contact linked to the company. Options are loaded from the connected account. |
| `product` | `string` | No | Product IDs to link to the feedback. Options are loaded from the connected account. |
| `persona` | `string` | No | The persona id Options are loaded from the connected account. |
| `tagIds` | `string[]` | No | Tag IDs to link to the feedback. Options are loaded from the connected account. |
| `externalId` | `string` | No | Filter feedback to return the feedback associated with a specific External ID. An example of an external ID is the ID of a record in a CRM or ID of a ticket in a customer support application. |
| `externalUrl` | `string` | No | Filter feedback to return the feedback associated with a specific external url. An example of an external url is that of a record in a CRM or a ticket in a customer support application |
| `feedback` | `string` | No | In case the feedback is not found, this will be used to create a new feedback. This field accepts HTML and is stored as UTF-8. |
| `name` | `string` | No | In case the feedback is not found, this will be used to create a new feedback. |

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

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: "prodpad-find-or-create-feedback",
  arguments: {
    customer: "Customer",
    company: "Company",
  },
})
```

**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: "prodpad-find-or-create-feedback",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    prodpad: { authProvisionId: "apn_xxxxxxx" },
    customer: "Customer",
    company: "Company",
  },
})

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": "prodpad-find-or-create-feedback",
    "configured_props": {
      "prodpad": { "authProvisionId": "apn_xxxxxxx" },
      "customer": "Customer",
      "company": "Company"
    }
  }'
```

---

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