Tool

Upsert row

The Google Sheets Upsert Row tool seamlessly integrates with Google Sheets to add or update rows of data efficiently. It simplifies data management by ensuring your spreadsheet stays current without duplicate entries.

Google Sheets

Features

  • Supports upserting rows by specifying a key column and value to identify existing records.
  • Automatically updates existing rows or inserts new rows based on the key's presence.
  • Allows selection of specific Drive, spreadsheet, and worksheet IDs to target precise locations.
  • Customizable insert arrays enable flexible input of multiple cell values per operation.
  • Includes comprehensive documentation with clear formatting requirements for smooth implementation.

Benefits

  • Ensures your Google Sheets data is always up-to-date with minimal manual effort.
  • Prevents duplicate data entries by intelligently managing inserts and updates.
  • Integrates easily into automated workflows, saving time and reducing errors.
  • Supports collaboration by allowing precise targeting of shared drives and sheets.
  • Enhances data reliability and consistency across your team’s spreadsheets.

Description

Upsert a row of data in a Google Sheet. See the documentation

IMPORTANT: The arguments have specific formats. Please follow the instructions below:

  • insert: Return JSON in this format: string[]

Parameters

7 parameters

NameTypeDescription
drivestring

Defaults to My Drive. To select a Shared Drive instead, select it from this list.

sheetIdrequiredstring

Select a spreadsheet or provide a spreadsheet ID

worksheetIdrequiredstring

Select a worksheet or provide a worksheet ID

insertrequiredstring[]

Insert statement: the row data you want to add to the Google sheet if the key doesn't exist. If the key does exist and Update is not set, the row will be updated using this array. Enter individual cell values or enter a custom expression to pass an array with each element representing a cell/column value (e.g. {{ [5, "test"] }}).

columnrequiredstring

The column of the sheet to lookup (e.g. A). This column functions as the key column for the upsert operation.

valuestring

The value of the key to search for in Key Column. Defaults to the value in Insert's "key" column if left blank.

updatesobject

Update statment: if the spreadsheet contains duplicate key Value in some row in the specified Column, individual cells in the first duplicate row will be updated using this object's column-value pairs.<br /> Enter the column name for the key (e.g. B) and the corresponding column value (e.g. test). You may also enter a custom expression and pass a JSON object with key/value pairs representing columns and values (e.g. {{ { A: 5, B: "test" } }}).

Try Needle today

Streamline AI productivity at your company today

Join thousands of people who have transformed their workflows.

Agentic workflowsAutomations, meet AI agents
AI SearchAll your data, searchable
Chat widgetsDrop-in widget for your website
Developer APIMake your app talk to Needle
    Needle LogoNeedle
    Like many websites, we use cookies to enhance your experience, analyze site traffic and deliver personalized content while you are here. By clicking "Accept", you are giving us your consent to use cookies in this way. Read our more on our cookie policy .