Update row in Google sheet using dynamic key

Hello,

I’m trying to fill some google sheet provided as input by an user.

Form:

  • User provide the ghseet url, the sheet tab, the column where the questions are and the column where the answer should be added.

The form works, I’m getting the sheet, I’m able to get the answer from the question.

My issue is to update the answer, but in a dynamic way.

Let says the following example:
gsheet 1 → Sheet name: Sheet1, Column A = question, Column B = Answer
gsheet 2 → Sheet name: Sheet2, Column C = question, Column E = Answer

My current workflow is the following:

I’m able to manually map the Key (Question) but this can change in another document.
Here some screenshot with context:
I’m extracting the question column, and only this column.

I’m get the answer, and as you can see I’m using the .value()[1] to get dynamically the content of the “Question” column without the need to use “Question”

And I would like to do the same in the Gsheet node for the Match on column (the red rectangle).

At the end, I just want the availability to use an expression instead of a dynamic list fetched by the node.

Any thought ?

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:

As a workaround, the node http can be used to achieve my goal:

hello @flo

you can retrieve rows from the gsheet and then find the row_number for the field which you need, then use that column for the match. It’s an internal column name so it will be always there

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