Insert value in a defined cell in Google spreadsheets

Good afternoon. Please help - I get a value from a webhook, and I need to insert it into a defined cell in a Google spreadsheet. For example, Sheet1!B3.

I can’t figure out how to do it - there is no key or header. Just in a definite cell.
Thanks in advance,
Regards, Aleksandr.

1 Like

Hi @asuhan, welcome to the community!

Have you tried the update operation, similar to what is described here (but with a range value starting at B3)?

Here’s an example workflow updating only cell B3:

Give me a shout if you run into any trouble with this or have any questions on what this workflow does.

1 Like

Thank you very much! Your example, of course, saw, but for now (I hope so far) too complicated.
Tell me, please, how in Mock Data node value “Foo” can be made dynamic, i.e. write there what comes by webhook?
Regards, Aleksandr.

Hi @asuhan, how to dynamically set the value depends on how your input data looks like.

If you want to set a value by simply opening a webhook URL such as https://your.n8n.url/webhook/sheets?text=hello in your browser, your workflow could look like so:

This example uses a Set node which references the value after text= through an expression, making further changes rather simple (simply connect a new node to the Set node an update the expression accordingly). The data is then transformed in the format expected by Google Sheets and finally written in cell B3.

Hope this helps! If you’re still having trouble here, could you share the JSON data returned by your webhook node?

Thank you very much again! Your answers helped to understand the essence of the solution.
I am just too impatient, but more to learn this really powerful tool.
Regards, Aleksandr.

1 Like

You are most welcome. To be honest, if you would have asked me two days ago, I would have had no clue on how to do this :wink:

Happy automating and please do reach out if anything else comes up!