Searching for null values

I imported a bunch of empty notes using an excel spreadsheet, and I need to clean up the database for my users. Because of the import method, both the owner ID and body are “null”, so it should be easy to flag the proper ids …

As an initial trial, I was trying to retrieve the note ids using a search API call on notes from the documentation (or from postman), with something akin to “hubspot_owner_id” EQ null, except I can’t seem to express this particular condition …

Has anyone tried, or have a clever workaround?

Thanks!

Hey, @PAtlan :waving_hand: Thanks for reaching out! Were you able to get this resolved?

I’ll add my example here in case other community members need a solution in the future:

  • Search operator used
    NOT_HAS_PROPERTY — Doesn't have a value for the specified property​

  • Postman request

    POST https://api.hubapi.com/crm/v3/objects/notes/search
    
    Body:
    {
     "properties": [
     "hubspot_owner_id"
     ],
     "filterGroups": [
     {
     "filters": [
     {
     "propertyName": "hubspot_owner_id",
     "operator": "NOT_HAS_PROPERTY"
     }
     ]
     }
     ]
    }​
    

    I included the option to Specify Returned Properties to make sure the owner IDs were in fact null.

  • Response

    {
     "total": 4,
     "results": [
     {
     "id": "23960621691",
     "properties": {
     "hs_createdate": "2022-07-26T17:15:34.601Z",
     "hs_lastmodifieddate": "2022-07-26T17:15:34.601Z",
     "hs_object_id": "23960621691",
     "hubspot_owner_id": null
     },
     "createdAt": "2022-07-26T17:15:34.601Z",
     "updatedAt": "2022-07-26T17:15:34.601Z",
     "archived": false
     },
     {
     "id": "25871672710",
     "properties": {
     "hs_createdate": "2022-09-20T20:31:35.783Z",
     "hs_lastmodifieddate": "2022-09-20T20:31:35.783Z",
     "hs_object_id": "25871672710",
     "hubspot_owner_id": null
     },
     "createdAt": "2022-09-20T20:31:35.783Z",
     "updatedAt": "2022-09-20T20:31:35.783Z",
     "archived": false
     },
     {
     "id": "25906880309",
     "properties": {
     "hs_createdate": "2022-09-21T18:16:57.395Z",
     "hs_lastmodifieddate": "2022-09-21T18:16:57.395Z",
     "hs_object_id": "25906880309",
     "hubspot_owner_id": null
     },
     "createdAt": "2022-09-21T18:16:57.395Z",
     "updatedAt": "2022-09-21T18:16:57.395Z",
     "archived": false
     },
     {
     "id": "29707018361",
     "properties": {
     "hs_createdate": "2023-01-09T20:42:33.832Z",
     "hs_lastmodifieddate": "2023-01-09T20:42:33.832Z",
     "hs_object_id": "29707018361",
     "hubspot_owner_id": null
     },
     "createdAt": "2023-01-09T20:42:33.832Z",
     "updatedAt": "2023-01-09T20:42:33.832Z",
     "archived": false
     }
     ]
    }​
    

Have fun building! — Jaycee