Cannot match Gsheets by row_number

Describe the problem/error/question

I have a trigger on gsheet when a new row added I run some actions and in the end I want to update the same row’s column “completed” with True flag.

The problem is I cannot update the same row in gsheet that triggered the workflow and I don’t have any other unique identifiers to match on. I cannot add a new column either.

It seems I cannot use expressions with row_number in Gsheets Update operation block, which is odd as it’s available in workflow execution and I can grab row_number in Telegram using exact same expression

What is the error message (if any)?

Invalid data[0]: Unable to parse range: Sheet1!G

Please share your workflow

Share the output returned by the last node

Trigger production output:

{
  "row_number": 17,
  "change_type": "added",
  "name": "",
  "email": "[email protected]",
  "credit": 1230,
  "done": "",
  "sent": "",
  "agent": "max",
  "ok": "",
  "result": ""
}

Trigger test output:

{
  "name": "Test",
  "email": "[email protected]",
  "credit": 50,
  "done": "",
  "sent": "Y",
  "agent": "max",
  "ok": "",
  "result": ""
}

It seems row_number is not available in test runs?

Information on your n8n setup

  • n8n version: 1.78.1
  • Database (default: SQLite):. N/A
  • n8n EXECUTIONS_PROCESS setting (default: own, main): ?
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system: N/A
  1. Which column are you trying to update with the “TRUE” value?
  2. Have you tried using the “Update by Row Number” operation instead?

Refer to the Google Sheets node documentation if needed for detailed operation types.

Use a Function node before your Google Sheets Update:

// Function node
return {
  json: {
    rowNumber: $node["Google Sheets Trigger"].json.row_number,
    data: { completed: true }  // Column name and value to update
  }
}

Then in Google Sheets Update:

  • Operation: “Update Row”
  • Sheet: “Sheet1”
  • Row Number: {{$json.rowNumber}}
  • Data: {{$json.data}}

This avoids the need for cell range formatting and works directly with the row number from your trigger.

If my solution helped you solve your query, please consider marking it as the solution! If you found it useful, a like would make my day! :blush: :+1:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.