<?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: Associating and object to a custom object based on a property field in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Associating-and-object-to-a-custom-object-based-on-a-property/m-p/697884#M30561</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/381293"&gt;@klloyd__1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually my main challenge is associating the custom object to the deal after i find the deal that has the matching property fied. I am using a custom object based workflow, and i am trying to associate the enrolled custom object to the deal i found.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you loads!&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/264909"&gt;@ChrisChiha&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 25 Sep 2022 11:45:57 GMT</pubDate>
    <dc:creator>ChrisChiha</dc:creator>
    <dc:date>2022-09-25T11:45:57Z</dc:date>
    <item>
      <title>Associating and object to a custom object based on a property field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Associating-and-object-to-a-custom-object-based-on-a-property/m-p/697391#M30550</link>
      <description>&lt;P&gt;Hello All,&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Anybody have a sample or a documentation for the below scenario?&lt;BR /&gt;I want to associate a custom object to a deal based on whether a certain property field in the deal matches another property field in the custom object.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;So for example:&lt;BR /&gt;If deal.status = customobject.status, associate this custom objetc to the deal.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;I am planning to do this through a js custom code, would really appreciate sharing some examples or documentations if any!&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Thank you!&lt;BR /&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/264909"&gt;@ChrisChiha&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 14:15:28 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Associating-and-object-to-a-custom-object-based-on-a-property/m-p/697391#M30550</guid>
      <dc:creator>ChrisChiha</dc:creator>
      <dc:date>2022-09-23T14:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Associating and object to a custom object based on a property field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Associating-and-object-to-a-custom-object-based-on-a-property/m-p/697514#M30552</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/264909"&gt;@ChrisChiha&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for reaching out. It's a great question. Let's see if we can get the conversation started. Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/257487"&gt;@LMeert&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/146"&gt;@Gonzalo&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/381293"&gt;@klloyd__1&lt;/a&gt;&amp;nbsp;have you tackled anything similar?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much! — Jaycee&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 17:00:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Associating-and-object-to-a-custom-object-based-on-a-property/m-p/697514#M30552</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2022-09-23T17:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: Associating and object to a custom object based on a property field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Associating-and-object-to-a-custom-object-based-on-a-property/m-p/697577#M30553</link>
      <description>&lt;P&gt;Thanks for the tag&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074"&gt;@Jaycee_Lewis&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/264909"&gt;@ChrisChiha&lt;/a&gt;&amp;nbsp;what you'll want to do is use the&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/api/crm/search" target="_blank" rel="noopener"&gt;CRM Search API&lt;/A&gt;&amp;nbsp;to find any existing deals with that matching property value.&amp;nbsp; I'm a little nervous about matching on something like status, since I assume there could be multiple Deals that all have the same status value.&amp;nbsp; If that's the case, you would probably want to add search criteria filters, to return on the specific deal you want.&amp;nbsp; If there's a match the CRM Search API would return the ID of the Deal record, which you could then associate to your custom object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm more of a Python guy, but this is how you could structure your CRM Search API request to find a Deal by status, written using Javascript Jquery:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var settings = {
  "url": "https://api.hubapi.com/crm/v3/objects/deals/search?hapikey=xxxxxxx",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/json"
  },
  "data": JSON.stringify({
    "filterGroups": [
      {
        "filters": [
          {
            "operator": "EQ",
            "propertyName": "status",
            "value": "in_progress"
          }
        ]
      }
    ]
  }),
};

$.ajax(settings).done(function (response) {
  console.log(response);
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 18:40:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Associating-and-object-to-a-custom-object-based-on-a-property/m-p/697577#M30553</guid>
      <dc:creator>klloyd__1</dc:creator>
      <dc:date>2022-09-23T18:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: Associating and object to a custom object based on a property field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Associating-and-object-to-a-custom-object-based-on-a-property/m-p/697884#M30561</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/381293"&gt;@klloyd__1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually my main challenge is associating the custom object to the deal after i find the deal that has the matching property fied. I am using a custom object based workflow, and i am trying to associate the enrolled custom object to the deal i found.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you loads!&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/264909"&gt;@ChrisChiha&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2022 11:45:57 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Associating-and-object-to-a-custom-object-based-on-a-property/m-p/697884#M30561</guid>
      <dc:creator>ChrisChiha</dc:creator>
      <dc:date>2022-09-25T11:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Associating and object to a custom object based on a property field</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Associating-and-object-to-a-custom-object-based-on-a-property/m-p/698091#M30570</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/264909"&gt;@ChrisChiha&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The association is done through this API call :&lt;/P&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;&lt;CODE class=""&gt;&lt;CODE class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class="" data-content="true" aria-describedby="tooltip-5" data-popover-id="uiopenpopup-69"&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;/crm/v4/objects/{objectType}/{objectId}/associations/{toObjectType}/{toObjectId}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/CODE&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;&amp;nbsp;
&lt;DIV class=""&gt;You have the objectId and when you run your search, you'll get the "toObjectId".
&lt;DIV class=""&gt;You're simply missing the objectTypes and to get them you can either make a call to get the object Schema of the object you're trying to associate OR you can also have a look at your settings :&lt;/DIV&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LMeert_0-1664179865248.png"&gt;&lt;img /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LMeert_0-1664179865248.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/75861i78467CACE53B0EB8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LMeert_0-1664179865248.png" alt="LMeert_0-1664179865248.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you go to your custom objects, open the "associations" tab, you'll see in the url :&lt;BR /&gt;The objectType of your custom object will be the content of the url parameter "type" (in my case 2-1786212), and your toObjectType will be the content of the url parameter "selectToObjectTypeId" (in my case 0-1 for contacts).&lt;BR /&gt;&lt;BR /&gt;There's an easier solution for you if you don't want to bother writing code : use the associ8 marketplace app, it lets you associate records based on a matching property.&lt;/P&gt;
&lt;P&gt;It's free and so far I haven't had a problem with it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps !&lt;BR /&gt;If it does, please consider marking this answer as a solution &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Ludwig&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 26 Sep 2022 08:44:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Associating-and-object-to-a-custom-object-based-on-a-property/m-p/698091#M30570</guid>
      <dc:creator>LMeert</dc:creator>
      <dc:date>2022-09-26T08:44:37Z</dc:date>
    </item>
  </channel>
</rss>

