Skip to main content
Glama

mcp-google-sheets

find-row.ts1.41 kB
import { Property, createAction } from '@activepieces/pieces-framework'; import { codaAuth } from '../..'; import { CodaRow, codaClient } from '../common/types'; import { columnIdsDropdown, docIdDropdown, tableIdDropdown } from '../common/props'; export const findRowAction = createAction({ auth: codaAuth, name: 'find-row', displayName: 'Find Row(s)', description: 'Find specific rows in the selected table using a column match search.', props: { docId: docIdDropdown, tableId: tableIdDropdown, searchColumn: columnIdsDropdown('Search Column', true), searchValue: Property.ShortText({ displayName: 'Search Value', required: true, }), }, async run(context) { const { docId, tableId, searchColumn, searchValue } = context.propsValue; const client = codaClient(context.auth); const matchedRows: CodaRow[] = []; let nextPageToken: string | undefined = undefined; do { const response = await client.listRows(docId, tableId, { query: `${searchColumn}:${JSON.stringify(searchValue)}`, sortBy: 'natural', useColumnNames: true, valueFormat: 'simpleWithArrays', visibleOnly: true, limit: 100, pageToken: nextPageToken, }); if (response.items) { matchedRows.push(...response.items); } nextPageToken = response.nextPageToken; } while (nextPageToken); return { found: matchedRows.length > 0, result: matchedRows, }; }, });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/activepieces/activepieces'

If you have feedback or need assistance with the MCP directory API, please join our Discord server