Hello dear community,
I am currently working on a workflow that will later be used to migrate data from one system to another via a CSV file. (Currently the software is not integrated)
In the first step “all” data from a system (e.g. hubspot) has to be exported (JSON). In the next step the data has to be partially renamed, not needed objects and lines deleted and re-sorted In the last step, the CSV export takes place and is sent, e.g. via Slack.
What currently works:
- get all hubspot data (get all)
- Renaming individual objects on the first level
What doesn’t work:
(1) the sorting
(2) renaming objects from the second level onwards
(3) the deletion of unnecessary!
Bildschirmfoto 2020-08-05 um 10.07.36|690x473 objects (unused lines)
What might be a possible solution to the problem described above?
{
"nodes": [
{
"parameters": {
"operation": "toFile",
"fileFormat": "csv",
"options": {
"fileName": ""
}
},
"name": "Spreadsheet File1",
"type": "n8n-nodes-base.spreadsheetFile",
"typeVersion": 1,
"position": [
1000,
300
]
},
{
"parameters": {
"keys": {
"key": [
{
"currentKey": "=properties",
"newKey": "ExampleChange"
}
]
}
},
"name": "Rename Keys",
"type": "n8n-nodes-base.renameKeys",
"typeVersion": 1,
"position": [
800,
300
]
},
{
"parameters": {
"resource": "contact",
"operation": "getAll",
"additionalFields": {}
},
"name": "Hubspot get all",
"type": "n8n-nodes-base.hubspot",
"typeVersion": 1,
"position": [
400,
300
],
"credentials": {
"hubspotApi": "Hubspot Sandbox //HD"
}
},
{
"parameters": {
"functionCode": "{delete form-submissions;}\n"
},
"name": "Function",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
600,
300
]
},
{
"parameters": {
"channel": "n8ntestchat",
"attachments": [
{
"fallback": "="
}
],
"otherOptions": {}
},
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 1,
"position": [
1200,
300
],
"credentials": {
"slackApi": "billwerk"
}
}
],
"connections": {
"Spreadsheet File1": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Rename Keys": {
"main": [
[
{
"node": "Spreadsheet File1",
"type": "main",
"index": 0
}
]
]
},
"Hubspot get all": {
"main": [
[
{
"node": "Function",
"type": "main",
"index": 0
}
]
]
},
"Function": {
"main": [
[
{
"node": "Rename Keys",
"type": "main",
"index": 0
}
]
]
}
}
}