node-red-contrib-google-sheets icon indicating copy to clipboard operation
node-red-contrib-google-sheets copied to clipboard

Append to the wrong cells

Open harryhow opened this issue 3 years ago • 8 comments

Any one has an issue that although I assigned D3 cell to be appended but it turns out A3 (and A4, A5...) to be written? Don't know why, following image on the right side is my log from my NodeRed debug message.

1st time is D3 to be written (this is correct), following turn becomes A4, A5 to be written. (this is wrong) Any leads on this issue? image

harryhow avatar Oct 25 '21 17:10 harryhow

What is the structure of the data you are writing (msg.payload)

On Mon, 25 Oct 2021 at 18:30, Harry Chen @.***> wrote:

Any one has an issue that although I assigned D3 cell to be appended but it turns out A3 (and A4, A5...) to be written? Don't know why, following image on the right side is my log from my NodeRed debug message.

1st time is D3 to be written (this is correct), following turn becomes A4, A5 to be written. (this is wrong) Any leads on this issue?

[image: image] https://user-images.githubusercontent.com/693098/138742123-5ca4a738-a5ee-4511-868c-82e130488040.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sammachin/node-red-contrib-google-sheets/issues/16, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABNZ7NW7WXKBKXECDGGOOLUIWH3JANCNFSM5GV2CL5Q .

sammachin avatar Oct 25 '21 19:10 sammachin

It's a simple message coming from MQTT text input. Looks like this image

New investigation: my google sheet is associated with a Google Form, once the sheet data on the Google Sheet has edited by the Google Form submission, the wrong cell appending behavior happened.

harryhow avatar Oct 26 '21 09:10 harryhow

Any one has an issue that although I assigned D3 cell to be appended but it turns out A3 (and A4, A5...) to be written? Don't know why, following image on the right side is my log from my NodeRed debug message.

1st time is D3 to be written (this is correct), following turn becomes A4, A5 to be written. (this is wrong) Any leads on this issue? image

Any solution in this?? I have the same problem. I'm trying to write in two different columns but always send the date to the first column.

santi19z avatar Feb 19 '24 04:02 santi19z

@santi19z are you also updating your sheet via a google form? this issue relates to that which seems to be a bug in the interaction between the google api and forms?

Could you provide an example of the issue?

sammachin avatar Feb 19 '24 11:02 sammachin

I'm not a Node-Red expert, but I'm trying to save data from a PLC into two different columns on the same sgoogle spreadsheet directly .

image

When I run the flow I get this result in the google spreadsheet.

Screenshot 2024-02-20 221827

santi19z avatar Feb 21 '24 04:02 santi19z

ok so this isn't a google forms related issue.

What is that S7 Volumen node doing, and what is the configuration in the google sheets node, you're splitting the flow after the S7 node so copies of the message will be sent to both sheets node and that will execute each one. Can you export an example flow so I can try to reproduce your issue

sammachin avatar Feb 21 '24 08:02 sammachin

ok so this isn't a google forms related issue.

What is that S7 Volumen node doing, and what is the configuration in the google sheets node, you're splitting the flow after the S7 node so copies of the message will be sent to both sheets node and that will execute each one. Can you export an example flow so I can try to reproduce your issue

The S7 Volumen node is just reading a number from a PLC. This variable is just for test, and with the timestamp node I was trying to inject the time and date in the column A of the Google Spreadsheet and the Volumen in the column B. But I get the wrong write in the file.

As an example I sending you the test of what I'm trying to do. You can ignore the S7 nodes. test_flow.json

santi19z avatar Feb 21 '24 17:02 santi19z

ok,

You are using the Appen Row funciton in the sheets node, so this will add a whole new row starting at the cell you specify.

If you want to write to 2 cells in the same row you need to combine those values into an array eg ["val1", "val2"] before sending it to the sheets node

sammachin avatar Feb 21 '24 17:02 sammachin