Dec 17, 2020 7:38 AM - edited Dec 17, 2020 7:38 AM
Hi all,
I'm trying to add Data to a custom object by the Hubspot NodeJS API Client.
But i don't have an option to add data to a custom object.
Is this posible via the provided hubspot connector?
(https://github.com/HubSpot/hubspot-api-nodejs)
Thank you,
Ronald
Solved! Go to Solution.
Dec 18, 2020 12:56 PM
Hey @RMones
Welcome to the Community!
Are you still working in this issue?
I did notice that there was a new release 3 days ago. Wonder if what you need was included
Dec 21, 2020 11:08 AM
Thanks for confirming!
Mar 9, 2021 9:17 PM - edited Mar 9, 2021 9:19 PM
For future posterity on this thread:
When using the HubSpot nodejs API client, if you want to access custom object data, the notation is like this:
hubspotClient.crm.objects.basicApi.getById('object-name',objectId,['propertyOne,'propertyTwo'])
Note that you access methods on the 'crm.objects' package, and then specify the custom object to access by passing the object name as a parameter argument.
Here's a bigger code sample, in which the code is accessing a custom object with the 'fully qualified object name' of p203693_product_incident'
hubspotClient.crm.objects.basicApi.getById('p203693_product_incident',event.object.objectId, ["product_name", "product_sku"])
.then(results => {
console.log(results.body)
let product_name = results.body.properties.product_name;
let product_sku = results.body.properties.product_sku;
callback({
outputFields: {
productSku: product_sku,
productName: product_name
}
});
})
.catch(err => {
console.error(err);
});
}
Dec 21, 2020 11:07 AM
@dennisedson that did the trick..
Thank you!
Dec 21, 2020 11:08 AM
Thanks for confirming!
Dec 18, 2020 1:17 PM
Dec 18, 2020 12:56 PM
Hey @RMones
Welcome to the Community!
Are you still working in this issue?
I did notice that there was a new release 3 days ago. Wonder if what you need was included