Association in bulk imports not created

Hi,

We have a situation that I’m a little mystified by: we’re using the import API to update a custom object and associate it with a company. We include a CSV file for both in our import request. For most records this works successfully: the object is updated and the association is created/updated. However, for about 1% of records, the association is not created.

This is how our

fileInputs

look from the import details (other column mappings elided):

 "fileImports": [
 {
 "columnDelimiter": null,
 "estimatedLineCount": 2081,
 "fileFormat": "CSV",
 "charset": "UTF-8",
 "fileId": ...,
 "pages": [
 {
 "columnMappings": [
 {
 "columnObjectType": null,
 "columnObjectTypeId": "0-2",
 "toColumnObjectTypeId": null,
 "engagementType": null,
 "columnName": "product_account_to_company",
 "propertyName": null,
 "ignored": false,
 "idColumnType": "HUBSPOT_OBJECT_ID",
 "columnType": "HUBSPOT_OBJECT_ID",
 "foreignKeyType": null,
 "associationLabels": null,
 "associationIdentifierColumn": true,
 "skipIfKnownColumn": false,
 "marketingEventSubmissionType": null
 }
 ],
 "hasHeader": true
 }
 ]
 },
 {
 "columnDelimiter": null,
 "estimatedLineCount": 2101,
 "fileFormat": "CSV",
 "charset": "UTF-8",
 "fileId": ...,
 "pages": [
 {
 "columnMappings": [
 {
 "columnObjectType": null,
 "columnObjectTypeId": "2-15776061",
 "toColumnObjectTypeId": null,
 "engagementType": null,
 "columnName": "hs_object_id",
 "propertyName": null,
 "ignored": false,
 "idColumnType": "HUBSPOT_OBJECT_ID",
 "columnType": "HUBSPOT_OBJECT_ID",
 "foreignKeyType": null,
 "associationLabels": null,
 "associationIdentifierColumn": false,
 "skipIfKnownColumn": false,
 "marketingEventSubmissionType": null
 },
 {
 "columnObjectType": null,
 "columnObjectTypeId": "2-15776061",
 "toColumnObjectTypeId": null,
 "engagementType": null,
 "columnName": "product_account_to_company",
 "propertyName": null,
 "ignored": false,
 "idColumnType": null,
 "columnType": "STANDARD",
 "foreignKeyType": {
 "associationCategory": "USER_DEFINED",
 "associationTypeId": 25
 },
 "associationLabels": null,
 "associationIdentifierColumn": false,
 "skipIfKnownColumn": false,
 "marketingEventSubmissionType": null
 },
 ...
 ],
 "hasHeader": true
 }
 ]
 }
 ],

I noticed there’s a toColumnObectTypeId in the payload that I don’t see documented. Maybe I should be setting something for that in the payload?

Has anyone run into something similar? Suggestions on how to handle this?

Thanks,

Nathan

Hi, @nyergler :waving_hand: Thanks for your question. I agree, tracking down an error with at or around a 1% occurrence is a challenge.

I have a few questions to help our community members better understand your issue.

  • In the times when this occurs, have you tried to make a GET request to /crm/v3/imports/{importId}/errors?
  • Have you tried running a few imports in smaller bathes? To try to isolate the issue
  • Have you tried double-checking the format of the product_account_to_company field in both CSV files?

Best,

Jaycee

Hi @Jaycee_Lewis are you able to advise regarding this issue? It is causing unrealiable data in HubSpot, requiring manual intervention to have HubSpot be of use.

Hi @Jaycee_Lewis ,

I have been fetching the import errors; the mysterious thing is that this doesn’t return an errors for the imports that are impacted.

We’re not seeing this when we create associations via the associations API (vs bulk import), so perhaps the batch size is related somehow?

With respect to the format in the import files, I’ve double checked this and it seems correct (numeric HS object identifiers). When I’ve taken example values directly from the import files and used them with the associations API, the association is created correctly, which leads me to believe the values are valid.

Any other ideas?

Thanks for your help,

NRY