APIs & Integrations

linkfuse
Contributor

Is there a way to search for objects that are *missing* an association?

We've tried searching associations.contact "NOT_HAS_PROPERTY", but it returns an error.

 

Are there any other ways to do this?

13 Replies 13
VPer
Participant

Is there a way to search for objects that are *missing* an association?

Hey,

I have a similar problem, Could you resolve it?

 

Thanks

linkfuse
Contributor

Is there a way to search for objects that are *missing* an association?

This is for tickets to contacts, specifically. Could that be the issue?

0 Upvotes
RMones
Contributor | Diamond Partner
Contributor | Diamond Partner

Is there a way to search for objects that are *missing* an association?

Hi @linkfuse and @dennisedson ,

 

with the current payload:

{
    "filters": [
        {
            "propertyName": "associations.contact",
            "operator": "NOT_HAS_PROPERTY"
        }
    ]
}

 

I've got also a 400 error.

{
"status": "error",
"message": "There was a problem with the request.",
"correlationId": "be038525-2741-4d36-8bef-ae151c4c820c"
}

 

You do also a POST request @dennisedson ?

Regards Ronald

dennisedson
HubSpot Product Team
HubSpot Product Team

Is there a way to search for objects that are *missing* an association?

@RMones 👀

This is a screenshot of my postman request (collapsed the results array)

Postman.png

RMones
Contributor | Diamond Partner
Contributor | Diamond Partner

Is there a way to search for objects that are *missing* an association?

Hi @dennisedson ,

 

Yes your example is working. But when change deals to tickets or a custom object ID, I've got a 400 http error..

 

Regards,

 

Ronald

dennisedson
HubSpot Product Team
HubSpot Product Team

Is there a way to search for objects that are *missing* an association?

Wow. So I somehow found the only one that works!  What are the odds....

I do not have a good answer for this.  I will do some research to see if this is working as designed.

linkfuse
Contributor

Is there a way to search for objects that are *missing* an association?

Hi! Were you able to determine if this is working as designed?

 

Thanks for your help!

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Is there a way to search for objects that are *missing* an association?

Working on it!  Promise to drop the answer here when I find out!

linkfuse
Contributor

Is there a way to search for objects that are *missing* an association?

It does seem to make sense as trying to get to contacts or tickets through workflows / the UI doesn't work either (we tried to set a property if the association was missing).

 

Contacts have associated deals as criterion, and tickets have associated companies, but not contacts as criterion.

TShma
Participant

Is there a way to search for objects that are *missing* an association?

We had similar issues - we could get Deals using associations.contact but not vice versa. This thread helped us working it out. Actually, you can use the filter in Hubsport (in the relevant screen for your case: Deals, Tickets, Contacts, etc.),  looking for "Associated X" and check its options. If there is such a filter, and it has an option "is known/unknown" it means you can use the NOT_HAS_PROPERTY (or HAS). If not, try to work out with what options there are.
In our case of finding Contacts without associated Deals the only relevant filter is "num_associated_deals", and it has an option (in Hubspot app) "is known" so one can check for "NOT_HAS_PROPERTY".
Hope it helps. 

RMones
Contributor | Diamond Partner
Contributor | Diamond Partner

Is there a way to search for objects that are *missing* an association?

Awesome! Thx 🙂

linkfuse
Contributor

Is there a way to search for objects that are *missing* an association?

Hmm... ours was part of a filterGroup. That must be the difference - we were searching for another known property as well, but we probably don't need to get that granular.

 

We'll try it again without the group.

 

Thanks!

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Is there a way to search for objects that are *missing* an association?

@linkfuse 

How are you structuring your body?

I sent this request and it seems to work:

{
    "filters": [
        {
            "propertyName": "associations.contact",
            "operator": "NOT_HAS_PROPERTY"
        }
    ]
}
0 Upvotes