Hey @huuich sorry for the late response. not sure if I fully understand what asked but check the example below and it should do the trick. Yes, the Google Sheets delete operation can be improved but in the meantime, you can use the index to delete whatever row you need to. I added an index field to my spreadsheet so that when the data goes to the delete operation can be used to delete the right row.
Example spreadsheet here.
And please next time create another topic since this is a question completely unrelated to Mautic and more about Google Sheets.
As always, if something does not make sense, simply get back to me.
{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
230,
300
]
},
{
"parameters": {
"authentication": "oAuth2",
"sheetId": "1G2anQwlwZqShQ_iyts1d1jzJoAahUss0I5CiaO3YweQ",
"range": "A:E",
"options": {
"valueRenderMode": "FORMATTED_VALUE"
}
},
"name": "GS Read Data",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 1,
"position": [
510,
290
],
"credentials": {
"googleSheetsOAuth2Api": "asasasasasas"
}
},
{
"parameters": {
"conditions": {
"number": [],
"string": [
{
"value1": "={{$node[\"GS Read Data\"].json[\"updated\"]}}",
"value2": "1"
}
]
}
},
"name": "IF Updated not equal 1",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
800,
290
]
},
{
"parameters": {
"authentication": "oAuth2",
"operation": "update",
"sheetId": "1G2anQwlwZqShQ_iyts1d1jzJoAahUss0I5CiaO3YweQ",
"range": "A:D",
"key": "mobile",
"options": {}
},
"name": "GS Read Data1",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 1,
"position": [
1370,
210
],
"credentials": {
"googleSheetsOAuth2Api": "asasasasasas"
}
},
{
"parameters": {
"authentication": "oAuth2",
"operation": "delete",
"sheetId": "1G2anQwlwZqShQ_iyts1d1jzJoAahUss0I5CiaO3YweQ",
"toDelete": {
"rows": [
{
"sheetId": 0,
"startIndex": "={{$node[\"NoOp\"].json[\"index\"]}}"
}
]
}
},
"name": "GS Read Data2",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 1,
"position": [
1380,
410
],
"credentials": {
"googleSheetsOAuth2Api": "asasasasasas"
}
},
{
"parameters": {},
"name": "NoOp",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
1050,
420
]
},
{
"parameters": {},
"name": "NoOp1",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
1050,
210
]
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "GS Read Data",
"type": "main",
"index": 0
}
]
]
},
"GS Read Data": {
"main": [
[
{
"node": "IF Updated not equal 1",
"type": "main",
"index": 0
}
]
]
},
"IF Updated not equal 1": {
"main": [
[
{
"node": "NoOp1",
"type": "main",
"index": 0
}
],
[
{
"node": "NoOp",
"type": "main",
"index": 0
}
]
]
},
"NoOp": {
"main": [
[
{
"node": "GS Read Data2",
"type": "main",
"index": 0
}
]
]
},
"NoOp1": {
"main": [
[
{
"node": "GS Read Data1",
"type": "main",
"index": 0
}
]
]
}
}
}