How to get constant cell address in google sheets?

I’m using data from the table’s first row, first and second column.


At the end of my script, the first line is deleted and replaced by the second.

If I use regular references to cells with data, then after the 1st cycle it becomes inoperative because it contains the values ​​of the cells with data themselves.

How to solve this issue? Are there any other types of links?

Information on your n8n setup

n8n version: 1.68.0
Database (default: SQLite): PostgreSQL
n8n EXECUTIONS_PROCESS setting (default: own, main): default: own, main
Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
Operating system: Ubuntu 22.04.5 LTS (GNU/Linux 5.15.0-125-generic x86_64)

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Information on your n8n setup

n8n version: 1.68.0
Database (default: SQLite): PostgreSQL
n8n EXECUTIONS_PROCESS setting (default: own, main): default: own, main
Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
Operating system: Ubuntu 22.04.5 LTS (GNU/Linux 5.15.0-125-generic x86_64)

Hey @maksilo , your question does not seem to be related to GSheet specifically but rather how to get the variable name instead of its value. The variable name appears to be a spreadsheet column name. Is that name not constant? Why don’t you just hardcode it instead of using an expression?

Anyway, to get the name of the variable if you know its value, you can use the following expression

{{ Object.keys($json).filter(i => {return $json[i] === "my_value"})[0] }}

I finally figured it out and inserted the variable name in the form {{ $json.col_1 }}.

But I still don’t understand why the Google block counts lines starting from the second, in the first it does not write the line number but simply the text row_number.

So I had to move all the data down one line, but that’s okay. I think the ticket can be closed, thanks for the answer!