Hi, I need to assign a new company as a primary one. I do this in the automation, via a custom code. At first I start with removing the existing association and later set a new primary company. Everything looks fine in a log, but give no result - the new company is still no a Primary one. It would be great to understand what can be the issue.
The issue might be that HubSpot needs time to process the disassociation before assigning the new primary. Try adding a short delay (1–2 seconds) between the archive and association steps, and use the batch/create method instead of PUT.
Hey, @HZaremba👋 thank for your question. To confirm, you are doing this via a custom coded workflow action, correct? Have you tried breaking these calls up and testing in Postman? — Jaycee
HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates. Learn More.
Did you know that the Community is available in other languages? Join regional conversations by changing your language settings !
PUT https://api.hubapi.com/crm/v4/objects/contact/{contactId}/associations/company/{bestCompanyId}
I'm sure there are other ways to test this, but it's how I would start.
Best,
Jaycee
HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates. Learn More.
Did you know that the Community is available in other languages? Join regional conversations by changing your language settings !