Is it possible to read only the last row of a spreadsheet file? I don’t know how many rows there is in the sheet but I want it to take the last populated.
Kind regards
Mattias
Is it possible to read only the last row of a spreadsheet file? I don’t know how many rows there is in the sheet but I want it to take the last populated.
Kind regards
Mattias
Check the example below;
{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"options": {}
},
"name": "Spreadsheet File",
"type": "n8n-nodes-base.spreadsheetFile",
"typeVersion": 1,
"position": [
790,
300
]
},
{
"parameters": {
"url": "https://www.cmu.edu/blackboard/files/evaluate/tests-example.xls",
"responseFormat": "file",
"options": {}
},
"name": "HTTP Request",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
530,
300
]
},
{
"parameters": {
"functionCode": "const length = items.length;\n\nreturn [\n {\n json: items[length - 1].json\n }\n]"
},
"name": "Get Last Row",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
1010,
300
]
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"Spreadsheet File": {
"main": [
[
{
"node": "Get Last Row",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request": {
"main": [
[
{
"node": "Spreadsheet File",
"type": "main",
"index": 0
}
]
]
}
}
}