Change HubSpot 'Contact IDs' field from multiOptions to something else

Describe the issue/error/question

I want to be able to pass a variable to the “Contact ID” field when creating a new HubSpot ticket in n8n. At the moment the field is multiOption which queries HubSpot and tries to list all contacts in the multi option field (which fails for us because we have over 40,000 contacts).

It would be more useful if this field would accept the Contact ID as a string.

What is the error message (if any)?

{“message”:“400 - {“status”:“error”,“message”:“One or more associations are invalid”,“correlationId”:“9bd37f28-9b22-4fd4-838a-d41233d30264”,“errors”:[“CONTACT=5 is not valid”,“CONTACT=4 is not valid”,“CONTACT=1 is not valid”,“CONTACT=2 is not valid”]}”,“name”:“Error”,“stack”:“Error: Request failed with status code 400\n at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n at IncomingMessage.emit (events.js:327:22)\n at endReadableNT (internal/streams/readable.js:1327:12)\n at processTicksAndRejections (internal/process/task_queues.js:80:21)”}

Please share the workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 0.166.0
  • Database you’re using (default: SQLite): DEFAULT DOCKER
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: DOCKER

Hey @Matt_W,

Does the workflow below work?

Example Workflow

Hey @jon ,

Your example workflow worked! What did you do different? Is it that you are passing the field an array instead of a string?

I tried an identical workflow earlier in the day but couldn’t get it to work.

Kind regards

Matt

1 Like

Hey @Matt_W,

You got it so I wrapped the contact id variable in [ ] because it looks like Hubspot wants an array and it did the top in my test instance.

Bit of a pain but on the plus side it works :slight_smile: