Hi everyone,
I’m still learning n8n, so it’s very possible that the solution is right in front of me and I just don’t see it yet ![]()
I’m trying to update multiple rows in Google Sheets, but I couldn’t make it work, even after trying several approaches.
My Google Sheets structure
I have a table with the following columns:
-
name– category name -
parent_name– parent category name (the parent exists in thenamecolumn, but not every category has a parent) -
name_id– ID of the category -
parent_id– ID of the parent category (this is what I want to fill automatically)
Example logic:
-
If
parent_nameis empty → this is a root category -
If
parent_nameis not empty → this category has a parent
What I’m trying to achieve
I have a list of many categories with parent-child relationships.
My goal is to build an automation in n8n that:
-
Reads all rows from Google Sheets
-
Finds all rows where
parent_nameis NOT empty -
For each of those rows:
-
Finds the row where
name == parent_name -
Takes its
name_id -
Writes this value into
parent_idof the child category
-
In short:
Match
parent_name→name, and copyname_id→parent_id
What I tried
-
Google Sheets → Get Rows + Update Row
-
Using AI Agent (probably not needed)
-
Different ways to loop through rows
But I always end up:
-
Updating only one row
-
Or not updating anything at all
I feel like I’m missing something basic about looping / batch processing or how to correctly update multiple rows.
Question
What is the correct n8n pattern for this use case?
-
Should I use
Split In Batches? -
Should I build a lookup object first?
-
Is there a recommended approach for updating multiple rows based on relationships inside the same sheet?
Any guidance or examples would be greatly appreciated ![]()
Thanks in advance!