Google Sheets cell update

Hi. I’m building a workflow to send contacts from Google Sheets to Google Contacts.

But I got stuck in one of the steps.

Every hour I want to read the spreadsheet and send to Contacts only the rows that are not filled with the word Sim (means ‘Yes’ in Portuguese) in column G.

But before sending to Contacts I want to insert the word Yes in column G so that the same contact is not sent twice. I’m stuck at this step.

The output of node which has the update sheet function seems to work correctly when I run it. But the spreadsheet is not updated.

Where is my mistake? Thanks!

Hi @lfilippi, when updating a sheet, the Google Sheet node would first try and find the correct row using the value specified in the Key column. This is typically an ID of some sort or another unique value (such as an email). It would then update each field using the incoming data.

So assuming you have a Google Sheet like this:

image

And your n8n data looks like so:

An Update operation would need to look like this:

This would be the result, with only the row with the correct ID being updated using the data of the incoming n8n item:

image

2 Likes

Thanks @MutedJam

Yes, my spreadsheet is similar to your example.

In the Set node I need the Value field to be dynamic: {{$json[“ID”]}}

When I manually enter an ID, the automation works. When I use dynamic ID it doesn’t work.

Is this the expected behavior?

Hey, this should work dynamically. When specifying ID (not {{$json["ID"]}}) in Key field of the node, n8n would read whatever value is in the ID field of the current item. It would not use a static value of ID.

Thanks @MutedJam

My spreadsheet had some inconsistent data so I had some problems.

But the issue was just setting the Key field properly.

1 Like

Awesome, glad to hear that was it!