What is the Difference Between the Google Sheets 'Add Row' and 'Upsert Row'?

This topic was automatically generated from Slack. You can find the original thread here.

Just a silly question. What is the difference between the Google Sheets Add Row and Upsert Row?

Sorry I mean the difference between upsert and update

How do I cycle through an array of arrays and add a google worksheet for each array object?

To cycle through an array of arrays and add a Google worksheet for each array object, you can use the following code snippet. Make sure to replace spreadsheetId with the ID of your Google Sheets document: ```
import { axios } from “@pipedream/platform”; export default defineComponent({ props: { google: { type: “app”, app: “google”, }, spreadsheetId: { type: “string”, label: “Spreadsheet ID”, }, arrayOfArrays: { type: “string[]”, label: “Array of Arrays”, }, }, async run({ steps, $ }) { const createWorksheet = async (sheetTitle) => { return await axios($, { method: “POST”, url: https://sheets.googleapis.com/v4/spreadsheets/${this.spreadsheetId}/sheets, headers: { Authorization: Bearer ${this.google.$auth.oauth_access_token}, “Content-Type”: “application/json”, }, data: { requests: [ { addSheet: { properties: { title: sheetTitle, }, }, }, ], }, }); }; for (const arrayObject of this.arrayOfArrays) { const sheetTitle = JSON.parse(arrayObject).join(“_”); await createWorksheet(sheetTitle); } }, });

Upsert means update the row if the record exists, and create a new row if the record is not exists. Typically you will need to specify a column as an ID to detect if the record exists or not

Awesome thanks