Looping and manage google sheet

Hello, i will explain my problem.
I am creating a flow that take data from google sheet and upload in database.
The point is, the sheet have columuns named like “Data1” “Data2” “Data3” etc…
I need to take the data of each column and add in the database.
So i was thinking to do a loop with a counter and every time increase the number and take the data from the column.

That’s sheet sample

That’s the flow now.

If i didn’t explain well, feel free to ask me everythings, THANKS!

Hi @Gabriele_Bracciali, perhaps you can confirm the data structure of your database? Would Data1, Data2, Data3, etc. also be columns in your database table (and which database exactly are you using)?

Nope i my database i need to save the data below the name of the column,
For Data1 Gab Bra, for data2 Dan Brow etc…
I am. using the sendinblue node for link the database, so no problem.

Okay, so you essentially want to turn your columns (starting from column B) into individual rows/n8n items?

Or in other words, instead of this:

…you’d rather have something like this?

I can’t think of a way to get this done without code, but based on your example I think something like this could work:

This should return individual n8n items for each column starting from B which should make it much easier to run subsequent nodes.

Okay yes, that’s a better solution than mine.
The next step should be a loop that upload Gab Bra,Dan Brow… etc in the DB

That should hopefully be simple - most nodes in n8n will run once for each item they receive. So, if you connect the Function node transforming the data to your database node it should insert all items :slight_smile:

okay yes, it’works.
Thanks for the help

1 Like

Glad to hear, thanks for confirming!