Google Sheets read and write actions for Weldable.
Part of the Weldable integration library — see @weldable/integration-core for the full catalog.
npm install @weldable/integration-google-sheets @weldable/integration-core@weldable/integration-core is a peer dependency and must be installed alongside this package.
import integration from '@weldable/integration-google-sheets'
// Read a range (returns a markdown table)
const read = integration.actions.find(a => a.id === 'google_sheets.read')!
const data = await read.execute(
{
spreadsheetId: '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms',
range: 'Sheet1!A1:D10',
},
ctx, // ActionContext from your Weldable-compatible host
)
console.log(data.markdown) // formatted table of the range
// Write values to a range
const edit = integration.actions.find(a => a.id === 'google_sheets.edit')!
await edit.execute(
{
spreadsheetId: '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms',
range: 'Sheet1!A2:C2',
values: [['Alice', '42', '2025-01-15']],
},
ctx,
)
// Create a new spreadsheet
const create = integration.actions.find(a => a.id === 'google_sheets.create')!
const sheet = await create.execute(
{
title: 'Sales data 2025',
values: [['Name', 'Amount', 'Date'], ['Alice', '500', '2025-01-15']],
},
ctx,
)
console.log(sheet.spreadsheetId)