View as Markdown
Google Sheets icon

Google Sheets ACTION

Format Cells

Apply formatting to a range of cells in a Google Sheets worksheet: bold/italic/underline, font size and family, text and background color, alignment, text wrapping, number formats (currency, percent, date), borders, and cell merging. Use this whenever a user asks to style, highlight, bold, color, align, wrap, merge, or number-format cells — including making a header row stand out. To change cell values instead, use Update Multiple Rows; to freeze rows or resize columns, use Format Worksheet; to style cells based on their contents, use Add Conditional Formatting. Use Get Spreadsheet Info to discover worksheet names, and Read Rows to see which cells hold the data you want to format. Colors accept a hex code (#1a73e8, #fff) or a common name (light gray, dark blue, yellow). range is A1 notation WITHOUT the worksheet name — A1:F1 (a block), B:B (a whole column), 2:2 (a whole row), or A1 (one cell). Only the attributes you pass are changed; everything else in the range keeps its current formatting. Example: to make the header row of a 6-column sheet bold, white on dark blue, and centered, call with sheetName="Financials", range="A1:F1", bold=true, textColor="#ffffff", backgroundColor="#1155cc", horizontalAlignment="CENTER" → returns the applied attributes plus a link to the worksheet. See the documentation
  • Action
  • Writes data
  • Destructive
  • OAuth
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Google Sheets account once, then configure and run Format Cells from your backend or agent.

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: "google_sheets-format-cells",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    google_sheets: { authProvisionId: "apn_xxxxxxx" },
    spreadsheetId: "Spreadsheet ID",
    sheetName: "Worksheet Name",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Format Cells inputs
Property Type Description
spreadsheetId Spreadsheet ID string
The spreadsheet ID from the Google Sheets URL. Use List Spreadsheets to find it by name.
Required
sheetName Worksheet Name string
The worksheet (tab) name. Use Get Spreadsheet Info to discover worksheet names.
Required
range Range string
The cells to format, in A1 notation and WITHOUT the worksheet name. Examples: A1:F1 (header row of 6 columns), B2:B100 (a block), B:B (an entire column), 3:3 (an entire row), A1 (a single cell).
Required
bold Bold boolean
Set true to bold the text, false to un-bold it. Omit to leave boldness unchanged.
Optional
italic Italic boolean
Set true to italicize, false to remove italics. Omit to leave unchanged.
Optional
underline Underline boolean
Set true to underline, false to remove the underline. Omit to leave unchanged.
Optional
strikethrough Strikethrough boolean
Set true to strike through the text, false to remove it. Omit to leave unchanged.
Optional
fontSize Font Size integer
Font size in points, e.g. 11 for body text or 14 for a title.
Optional
fontFamily Font Family string
Font family name as it appears in the Google Sheets font menu, e.g. Arial, Roboto, Courier New.
Optional
textColor Text Color string
Font color as a hex code (#ffffff) or a common color name (dark blue, red, white).
Optional
backgroundColor Background Color string
Cell fill color as a hex code (#d9d9d9) or a common color name (light gray, light yellow). This is the usual way to highlight cells or shade a header row.
Optional
horizontalAlignment Horizontal Alignment string
Horizontal text alignment within each cell.
Optional
verticalAlignment Vertical Alignment string
Vertical text alignment within each cell.
Optional
wrapStrategy Wrap Strategy string
How text behaves when it is wider than the cell. WRAP shows it on multiple lines (and grows the row height), CLIP cuts it off at the cell edge, OVERFLOW_CELL lets it spill into empty neighboring cells.
Optional
numberFormat Number Format string
How numbers, dates and times in the range are displayed. Pick a named preset — e.g. currency_usd shows 1234.5 as $1,234.50, percent shows 0.42 as 42%, date shows a date as 2026-09-10, plain_text stops Sheets from auto-converting entries like 1-2 into dates, and automatic resets to the default. For a format not listed here, use numberFormatPattern.
Optional
numberFormatPattern Number Format Pattern string
A custom Google Sheets number-format pattern, for formats the numberFormat presets don't cover — e.g. 0.000, #,##0 "units", mmm d, yyyy. Overrides numberFormat when both are given.
Optional
borders Borders string
Which edges to draw borders on. ALL borders every cell in the range, OUTER draws only the outside edge, INNER only the lines between cells, NONE removes all borders in the range.
Optional
borderStyle Border Style string
Line style for the borders. Defaults to SOLID. Ignored when borders is NONE.
Optional
borderColor Border Color string
Border color as a hex code or common name. Defaults to black.
Optional
merge Merge string
Merge or unmerge the range — typically for a title banner spanning several columns. MERGE_ALL makes the whole range one cell, MERGE_COLUMNS merges each column vertically, MERGE_ROWS merges each row horizontally, UNMERGE splits previously merged cells back apart. Merging needs a bounded range (A1:F1), not an open-ended one (A:F), and it keeps only the top-left value — anything else in the range is discarded, so merge across empty cells, not over data.
Optional
clearFormatting Clear Formatting boolean
Set true to reset the range to default formatting (removes bold, colors, borders and number formats). Applied before any other options in the same call, so you can clear and restyle in one step.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
google_sheets-format-cells
Version
0.0.1
App
Google Sheets
Authentication
OAuth
Read-only
No
Destructive
Yes
Open world
Yes