<?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 Duplicate associations? in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Duplicate-associations/m-p/672495#M55293</link>
    <description>&lt;P&gt;Does the HubSpot CRM have built-in logic to prevent duplicate associations from being created?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I mean is this: I have a nightly job that executes, pulling customer/loan/etc. data from a different external system.&amp;nbsp; For each incoming record, the code creates the new record in HubSpot if it doesn't exist (based on key fields I've identified), otherwise it updates it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The job's code also creates the needed associations: for each loan, after creating or updating it, it creates an association between the loan and its related customer (using the PUT method described in your documentation &lt;A href="https://developers.hubspot.com/docs/api/crm/associations" target="_blank" rel="noopener"&gt;here&lt;/A&gt;).&amp;nbsp; For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/crm/v4/objects/contacts/12345/associations/loans/67890&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is: what if a contact-to-loan association already exists between the contact with ID 12345 and the loan with ID 67890?&amp;nbsp; Does HubSpot create a brand new (duplicate) association?&amp;nbsp; Does it return an error/exception?&amp;nbsp; Or does it merely not create the association and exit quietly?&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jul 2022 21:43:40 GMT</pubDate>
    <dc:creator>CBryant4</dc:creator>
    <dc:date>2022-07-28T21:43:40Z</dc:date>
    <item>
      <title>Duplicate associations?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Duplicate-associations/m-p/672495#M55293</link>
      <description>&lt;P&gt;Does the HubSpot CRM have built-in logic to prevent duplicate associations from being created?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I mean is this: I have a nightly job that executes, pulling customer/loan/etc. data from a different external system.&amp;nbsp; For each incoming record, the code creates the new record in HubSpot if it doesn't exist (based on key fields I've identified), otherwise it updates it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The job's code also creates the needed associations: for each loan, after creating or updating it, it creates an association between the loan and its related customer (using the PUT method described in your documentation &lt;A href="https://developers.hubspot.com/docs/api/crm/associations" target="_blank" rel="noopener"&gt;here&lt;/A&gt;).&amp;nbsp; For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/crm/v4/objects/contacts/12345/associations/loans/67890&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is: what if a contact-to-loan association already exists between the contact with ID 12345 and the loan with ID 67890?&amp;nbsp; Does HubSpot create a brand new (duplicate) association?&amp;nbsp; Does it return an error/exception?&amp;nbsp; Or does it merely not create the association and exit quietly?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 21:43:40 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Duplicate-associations/m-p/672495#M55293</guid>
      <dc:creator>CBryant4</dc:creator>
      <dc:date>2022-07-28T21:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate associations?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Duplicate-associations/m-p/672575#M55300</link>
      <description>&lt;P&gt;In my testing, if the association already exists for those two objects, it'll work fine. It's important to note that the association can have multiple association labels which is the default case for Companies as there can be a Primary and other custom defined ones.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If a Contact -&amp;gt; Company association exists and your API call is only providing a single user defined association label, it will clear the Primary association. In other words, it's not appending to the array of association labels, it's replacing it. This would be the case if you are using multiple association labels for other associations in your portal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So just ensure you are providing ALL of the assoication types everytime you run a PUT.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 02:19:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Duplicate-associations/m-p/672575#M55300</guid>
      <dc:creator>LeeBartelme</dc:creator>
      <dc:date>2022-07-29T02:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate associations?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Duplicate-associations/m-p/673076#M55337</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/401263"&gt;@LeeBartelme&lt;/a&gt;&amp;nbsp; - this answers my question&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 22:11:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Duplicate-associations/m-p/673076#M55337</guid>
      <dc:creator>CBryant4</dc:creator>
      <dc:date>2022-07-29T22:11:44Z</dc:date>
    </item>
  </channel>
</rss>

