Skip to main content
Glama

mcp-google-sheets

refresh-charts.ts1.75 kB
import { createAction, Property } from '@activepieces/pieces-framework'; import { batchUpdate, getSlide, PageElement } from '../commons/common'; import { googleSlidesAuth } from '../..'; export const refreshSheetsCharts = createAction({ name: 'refresh_sheets_charts', displayName: 'Refresh Sheets Charts', description: 'Refresh all Google Sheets charts in the presentation', auth: googleSlidesAuth, props: { presentation_id: Property.ShortText({ displayName: 'Presentation ID', description: 'The ID of the presentation, between /d and /edit', required: true, }), }, async run(context) { const { presentation_id } = context.propsValue; const { access_token } = context.auth; const presentation = await getSlide(access_token, presentation_id); const requests: { refreshSheetsChart: { objectId: string; }; }[] = []; presentation.slides?.forEach((slide) => { slide.pageElements?.forEach((element: PageElement) => { if (element.sheetsChart) { const refreshRequest = { refreshSheetsChart: { objectId: element.objectId } }; requests.push(refreshRequest); } }); }); if (requests.length > 0) { const result = await batchUpdate(access_token, presentation_id, requests); return { success: true, message: `Successfully refreshed ${requests.length} Google Sheets charts`, result: result }; } else { return { success: false, message: 'No Google Sheets charts found in the presentation' }; } } });

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