Hello, I have doubts and I would like to know if you can help me
I’m reading a spreadsheet and receiving more than one output for the flow
And I’m trying to do the split function to separate the first name from the full name
And it works, but only for the first output of the spreadsheet
{
"nodes": [
{
"parameters": {
"authentication": "oAuth2",
"sheetId": "19",
"range": "Automação!A:G",
"options": {
"continue": true
}
},
"name": "Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 1,
"position": [
760,
350
],
"credentials": {
"googleSheetsOAuth2Api": "EduardoOAuth"
}
},
{
"parameters": {
"conditions": {
"boolean": [],
"string": [
{
"value1": "={{$node[\"Google Sheets\"].json[\"Variação\"]}}",
"operation": "isEmpty"
}
],
"number": []
}
},
"name": "IF",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
920,
350
]
},
{
"parameters": {
"functionCode": "items[0].json.incomingText = $node[\"Google Sheets\"].json[\"Nome\"];\nreturn items;"
},
"name": "Function",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
790,
610
]
},
{
"parameters": {
"functionCode": "const text = items[0].json.incomingText.split(' ')\nreturn [\n {\n json: { textSplited: text } \n }\n]\n\n"
},
"name": "Function1",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
930,
610
]
},
{
"parameters": {
"values": {
"string": [
{
"name": "FirstName",
"value": "={{$node[\"Function1\"].json[\"textSplited\"][0]}}"
}
]
},
"options": {}
},
"name": "Set15",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
1080,
610
]
}
],
"connections": {
"Google Sheets": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0
}
]
]
},
"IF": {
"main": [
null,
[
{
"node": "Function",
"type": "main",
"index": 0
}
]
]
},
"Function": {
"main": [
[
{
"node": "Function1",
"type": "main",
"index": 0
}
]
]
},
"Function1": {
"main": [
[
{
"node": "Set15",
"type": "main",
"index": 0
}
]
]
}
}
}