Workflow custom code: Create association to custom object
SOLVE
Hello. My company just purchased Ops hub pro and I'm taking advantage of the custom code actions in the workflows to create an association between a Company and a custom object. Unfortunately I'm not to advanced at JS as you can see from the code below. I'm attempting to pull in two properties from the Company object (Company ID (hs_object_id( and a custom Company property (china_company_id) to use in the code. When I test the code it threw some undefined errors, ":"Runtime.UserCodeSyntaxError". I assume its from the variables for those two properties I'm bring in.
Any feedback would be helpful. Thanks in advance.
const hubspot = require('@hubspot/api-client');
const hubspotClient = new hubspot.Client({ apiKey: process.env.HAPIKEY });
Workflow custom code: Create association to custom object
SOLVE
Thank you very much for the feedback, I really appreciate it. So if I understand the code correctly when it runs it will associate all pairs of objects identified in the request body, which in the code above is lead activites and contacts, correct? If so, I have the association between Company and the Custom Object already established. What I'm trying to do is associate a specific Company (hs_object_id) in the Company object with its sibling Company in the Custom Object. Sorry if I'm mudding up the water. Thank you again...