<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Create Custom Object Association in Custom code in Workflow in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Create-Custom-Object-Association-in-Custom-code-in-Workflow/m-p/639746#M53646</link>
    <description>&lt;P&gt;Hello, I am in a similar situation as&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/135859"&gt;@Sylg&lt;/a&gt;. And this solution is not working for me.&lt;BR /&gt;&lt;BR /&gt;I am creating a workflow with custom code actions that needs to look up associations for one custom object to another custom object.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So I have tested and confirmed this endpoint is working from the docs:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-05-26 at 1.22.05 PM.png" style="width: 506px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/67306i33D5A0726D308060/image-dimensions/506x340?v=v2" width="506" height="340" role="button" title="Screen Shot 2022-05-26 at 1.22.05 PM.png" alt="Screen Shot 2022-05-26 at 1.22.05 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And brought the relevant code into the custom code action in my workflow. But I ran into same error as mentioned above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"errorType":"TypeError","errorMessage":"Cannot read property 'getAll' of undefined","stack":[ ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then I found this thread! So I have updated my script within the custom code action to include&amp;nbsp;hubspotClient.crm.&lt;STRONG&gt;objects&lt;/STRONG&gt;.associationsApi.getAll(...), as seen below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-05-26 at 1.22.35 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/67309i8CA8D8334B47E0C1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-05-26 at 1.22.35 PM.png" alt="Screen Shot 2022-05-26 at 1.22.35 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; And now I am running into this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ERROR	{
  "statusCode": 500,
  "body": {
    "status": "error",
    "message": "internal error",
    "correlationId": "164444ce-8a12-4bd6-bf03-9538ee174fd9"
  } ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At this point, I'm kinda lost! Anybody know how to list associations from custom object to custom object correctly?&lt;/P&gt;</description>
    <pubDate>Thu, 26 May 2022 18:28:07 GMT</pubDate>
    <dc:creator>NMueller</dc:creator>
    <dc:date>2022-05-26T18:28:07Z</dc:date>
    <item>
      <title>Create Custom Object Association in Custom code in Workflow</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Create-Custom-Object-Association-in-Custom-code-in-Workflow/m-p/514675#M48000</link>
      <description>&lt;P&gt;Hey Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm building a workflow that will&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;find the associated company of a workspace (custom object)&lt;/LI&gt;&lt;LI&gt;look if this company has an associated open deal&lt;/LI&gt;&lt;LI&gt;If so, associate the workspace to the deal&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;On paper, this is straight forward but I can't find the function of the nodeJs library to lookup association on a custom object and to create an association on a custom object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to the &lt;A href="https://developers.hubspot.com/docs/api/crm/crm-custom-objects" target="_blank" rel="noopener"&gt;CRM API v3 docs&lt;/A&gt;,&amp;nbsp;it should be&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;hubspotClient.crm.associationsApi.getAll(objectType, objectId, toObjectType, after, limit);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;to lookup an association but this return&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{"errorType":"TypeError","errorMessage":"Cannot read property 'getAll' of undefined","stack":["TypeError: Cannot read property 'getAll' of undefined","    at Object.exports.main&lt;/PRE&gt;&lt;P&gt;I tried doing the call via HTTP in Postman and the endpoint work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone tell me the function to lookup associated objects and the function to create an association with a custom object, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 20:08:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Create-Custom-Object-Association-in-Custom-code-in-Workflow/m-p/514675#M48000</guid>
      <dc:creator>Sylg</dc:creator>
      <dc:date>2021-10-22T20:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Create Custom Object Association in Custom code in Workflow</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Create-Custom-Object-Association-in-Custom-code-in-Workflow/m-p/515424#M48036</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/138846"&gt;@kierana&lt;/a&gt;&amp;nbsp; maybe you have some ideas &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 15:56:28 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Create-Custom-Object-Association-in-Custom-code-in-Workflow/m-p/515424#M48036</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2021-10-25T15:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Create Custom Object Association in Custom code in Workflow</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Create-Custom-Object-Association-in-Custom-code-in-Workflow/m-p/515428#M48037</link>
      <description>&lt;P&gt;The documentation is actually incorrect for this - It's always worth using Intellisense in your IDE to get the right methods. Try&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;hubspotClient.crm.objects.associationsApi.getAll(.....)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 25 Oct 2021 16:03:38 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Create-Custom-Object-Association-in-Custom-code-in-Workflow/m-p/515428#M48037</guid>
      <dc:creator>kierana</dc:creator>
      <dc:date>2021-10-25T16:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create Custom Object Association in Custom code in Workflow</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Create-Custom-Object-Association-in-Custom-code-in-Workflow/m-p/639746#M53646</link>
      <description>&lt;P&gt;Hello, I am in a similar situation as&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/135859"&gt;@Sylg&lt;/a&gt;. And this solution is not working for me.&lt;BR /&gt;&lt;BR /&gt;I am creating a workflow with custom code actions that needs to look up associations for one custom object to another custom object.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So I have tested and confirmed this endpoint is working from the docs:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-05-26 at 1.22.05 PM.png" style="width: 506px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/67306i33D5A0726D308060/image-dimensions/506x340?v=v2" width="506" height="340" role="button" title="Screen Shot 2022-05-26 at 1.22.05 PM.png" alt="Screen Shot 2022-05-26 at 1.22.05 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And brought the relevant code into the custom code action in my workflow. But I ran into same error as mentioned above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"errorType":"TypeError","errorMessage":"Cannot read property 'getAll' of undefined","stack":[ ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then I found this thread! So I have updated my script within the custom code action to include&amp;nbsp;hubspotClient.crm.&lt;STRONG&gt;objects&lt;/STRONG&gt;.associationsApi.getAll(...), as seen below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-05-26 at 1.22.35 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/67309i8CA8D8334B47E0C1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-05-26 at 1.22.35 PM.png" alt="Screen Shot 2022-05-26 at 1.22.35 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; And now I am running into this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ERROR	{
  "statusCode": 500,
  "body": {
    "status": "error",
    "message": "internal error",
    "correlationId": "164444ce-8a12-4bd6-bf03-9538ee174fd9"
  } ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At this point, I'm kinda lost! Anybody know how to list associations from custom object to custom object correctly?&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 18:28:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Create-Custom-Object-Association-in-Custom-code-in-Workflow/m-p/639746#M53646</guid>
      <dc:creator>NMueller</dc:creator>
      <dc:date>2022-05-26T18:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create Custom Object Association in Custom code in Workflow</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Create-Custom-Object-Association-in-Custom-code-in-Workflow/m-p/639764#M53647</link>
      <description>&lt;P&gt;Gah! Just discovered, I need to utilize V4 API documentation as seen here&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/api/crm/associations" target="_blank"&gt;https://developers.hubspot.com/docs/api/crm/associations&lt;/A&gt;&amp;nbsp;to get this working. I've updated my custom code in workflow, and it is working now with V4 formatted request:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-05-26 at 2.48.16 PM.png" style="width: 365px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/67315i1173F6FC07E36F20/image-dimensions/365x555?v=v2" width="365" height="555" role="button" title="Screen Shot 2022-05-26 at 2.48.16 PM.png" alt="Screen Shot 2022-05-26 at 2.48.16 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 18:50:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Create-Custom-Object-Association-in-Custom-code-in-Workflow/m-p/639764#M53647</guid>
      <dc:creator>NMueller</dc:creator>
      <dc:date>2022-05-26T18:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create Custom Object Association in Custom code in Workflow</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Create-Custom-Object-Association-in-Custom-code-in-Workflow/m-p/842052#M66968</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/135859"&gt;@Sylg&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;I know this thread is a bit old but have you heard of Associ8? It associates objects (Custom Objects included) via workflow based off criteria you set!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DStaat_0-1693339004798.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/97952iCAF6F3EC5263F758/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DStaat_0-1693339004798.png" alt="DStaat_0-1693339004798.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;You can check it out on the HubSpot Marketplace &lt;A href="https://ecosystem.hubspot.com/marketplace/apps/productivity/workflow-automation/associations-app-272901" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;If you have any questions, feel free to reach out to me!&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;&lt;BR /&gt;-David Staat&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 19:58:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Create-Custom-Object-Association-in-Custom-code-in-Workflow/m-p/842052#M66968</guid>
      <dc:creator>DStaat</dc:creator>
      <dc:date>2023-08-29T19:58:16Z</dc:date>
    </item>
  </channel>
</rss>

