I’m using Hubspot crm/v3/imports
API, sadly not part of Hubspot node so doing it manually.
All in all it’s not that complicated, you give it JSON with mapping and a csv file.
What is the error message (if any)?
I keep getting “source.on is not a function”. I did bunch of digging and error is given by n8n, call never goes to hubspot.
It seem like this error usually means JSON has some issues.
I’ve run out of ideas tbh, error doesn’t give any details what exactly is wrong but it seems it complains about the “importRequest” as swapping that into simple string sends the API to hubspot at least.
Please share your workflow
This is JSON as shown from “{{ $(‘importRequest’).item.json }}”
[Object: {"name": "salesExec - July", "importOperations": {"0-1": "UPSERT"}, "dateFormat": "DAY_MONTH_YEAR", "files": [{"fileName": "spreadsheet.csv", "fileFormat": "CSV", "fileImportPage": {"hasHeader": true, "columnMappings": [{"columnObjectTypeId": "0-1", "columnName": "firstname", "propertyName": "firstname"},{"columnObjectTypeId": "0-1", "columnName": "backyard_user_id", "propertyName": "backyard_user_id"},{"columnObjectTypeId": "0-1", "columnName": "company_number", "propertyName": "company_number"},{"columnObjectTypeId": "0-1", "columnName": "company", "propertyName": "company"},{"columnObjectTypeId": "0-1", "columnName": "hubspot_owner_id", "propertyName": "hubspot_owner_id"},{"columnObjectTypeId": "0-1", "columnName": "email", "propertyName": "email", "columnType": "HUBSPOT_ALTERNATE_ID"}]}}]}]
This is actually JSON I’ve made
[
{
"name": "salesExec - July",
"importOperations": {
"0-1": "UPSERT"
},
"dateFormat": "DAY_MONTH_YEAR",
"files": [
{
"fileName": "spreadsheet.csv",
"fileFormat": "CSV",
"fileImportPage": {
"hasHeader": true,
"columnMappings": [
{
"columnObjectTypeId": "0-1",
"columnName": "firstname",
"propertyName": "firstname"
},
{
"columnObjectTypeId": "0-1",
"columnName": "backyard_user_id",
"propertyName": "backyard_user_id"
},
{
"columnObjectTypeId": "0-1",
"columnName": "company_number",
"propertyName": "company_number"
},
{
"columnObjectTypeId": "0-1",
"columnName": "company",
"propertyName": "company"
},
{
"columnObjectTypeId": "0-1",
"columnName": "hubspot_owner_id",
"propertyName": "hubspot_owner_id"
},
{
"columnObjectTypeId": "0-1",
"columnName": "email",
"propertyName": "email",
"columnType": "HUBSPOT_ALTERNATE_ID"
}
]
}
}
]
}
]