<?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 CRM Search API OR Logic Reducing Results in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/CRM-Search-API-OR-Logic-Reducing-Results/m-p/1104569#M80139</link>
    <description>&lt;P&gt;When using the CRM Search with OR logic, additional filters are reducing results, but OR should never reduce a result set, it should only ever increase or stay the same.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;What am I missing?&lt;BR /&gt;&lt;BR /&gt;Example filter bodies below:&lt;BR /&gt;Returns 475 as a total.&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;{
  "filterGroups": [
    {
      "filters": [
        {
          "propertyName": "hs_analytics_last_visit_timestamp",
          "operator": "GT",
          "value": "1738540800000"
        }
      ]
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Adding OR logic returns 474 total:&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "filterGroups": [
    {
      "filters": [
        {
          "propertyName": "hs_analytics_last_visit_timestamp",
          "operator": "GT",
          "value": "1738540800000"
        }
      ],
      "filters": [
        {
          "propertyName": "hs_analytics_last_timestamp",
          "operator": "GT",
          "value": "1738540800000"
        }
      ]
    }
  ]
}​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Feb 2025 23:22:29 GMT</pubDate>
    <dc:creator>MJohnson59</dc:creator>
    <dc:date>2025-02-05T23:22:29Z</dc:date>
    <item>
      <title>CRM Search API OR Logic Reducing Results</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/CRM-Search-API-OR-Logic-Reducing-Results/m-p/1104569#M80139</link>
      <description>&lt;P&gt;When using the CRM Search with OR logic, additional filters are reducing results, but OR should never reduce a result set, it should only ever increase or stay the same.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;What am I missing?&lt;BR /&gt;&lt;BR /&gt;Example filter bodies below:&lt;BR /&gt;Returns 475 as a total.&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;{
  "filterGroups": [
    {
      "filters": [
        {
          "propertyName": "hs_analytics_last_visit_timestamp",
          "operator": "GT",
          "value": "1738540800000"
        }
      ]
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Adding OR logic returns 474 total:&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "filterGroups": [
    {
      "filters": [
        {
          "propertyName": "hs_analytics_last_visit_timestamp",
          "operator": "GT",
          "value": "1738540800000"
        }
      ],
      "filters": [
        {
          "propertyName": "hs_analytics_last_timestamp",
          "operator": "GT",
          "value": "1738540800000"
        }
      ]
    }
  ]
}​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 23:22:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/CRM-Search-API-OR-Logic-Reducing-Results/m-p/1104569#M80139</guid>
      <dc:creator>MJohnson59</dc:creator>
      <dc:date>2025-02-05T23:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: CRM Search API OR Logic Reducing Results</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/CRM-Search-API-OR-Logic-Reducing-Results/m-p/1104737#M80146</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/895103"&gt;@MJohnson59&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To apply OR logic, include multiple filters within a filter group. You can include a maximum of five filter groups with up to 6 filters in each group, with a maximum of 18 filters in total. &lt;BR /&gt;here is the link to the doc :&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/guides/api/crm/search" target="_blank"&gt;https://developers.hubspot.com/docs/guides/api/crm/search&lt;/A&gt;&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="GRajput_0-1738833990760.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/137746iFF529042EE076D33/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GRajput_0-1738833990760.png" alt="GRajput_0-1738833990760.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-sheets-root="1"&gt;I hope this will help you out. Please mark it as &lt;STRONG&gt;Solution Accepted and upvote&lt;/STRONG&gt; to help another Community member.&lt;BR /&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 09:27:30 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/CRM-Search-API-OR-Logic-Reducing-Results/m-p/1104737#M80146</guid>
      <dc:creator>GRajput</dc:creator>
      <dc:date>2025-02-06T09:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: CRM Search API OR Logic Reducing Results</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/CRM-Search-API-OR-Logic-Reducing-Results/m-p/1104886#M80157</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/346639"&gt;@GRajput&lt;/a&gt;&amp;nbsp;thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, unless I'm mistaken, I am already applying the OR logic. My concern is that it's not working as I would imagine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OR is reducing the result set when I would expect it to always only increase, or in the case of no data returned from Or, stay the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I use the OR logic in my original example I'm see fewer results returned.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 14:07:18 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/CRM-Search-API-OR-Logic-Reducing-Results/m-p/1104886#M80157</guid>
      <dc:creator>MJohnson59</dc:creator>
      <dc:date>2025-02-06T14:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: CRM Search API OR Logic Reducing Results</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/CRM-Search-API-OR-Logic-Reducing-Results/m-p/1104979#M80162</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/895103"&gt;@MJohnson59&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like you might be missing a couple of curly brackets, which creates AND logic between the two filters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you see if this updated version returns more results?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
  "filterGroups": [
    {
      "filters": [
        {
          "propertyName": "hs_analytics_last_visit_timestamp",
          "operator": "GT",
          "value": "1738540800000"
        }
      ]
    },
    {
      "filters": [
        {
          "propertyName": "hs_analytics_last_timestamp",
          "operator": "GT",
          "value": "1738540800000"
        }
      ]
    }
  ]
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 16:03:54 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/CRM-Search-API-OR-Logic-Reducing-Results/m-p/1104979#M80162</guid>
      <dc:creator>evaldas</dc:creator>
      <dc:date>2025-02-06T16:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: CRM Search API OR Logic Reducing Results</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/CRM-Search-API-OR-Logic-Reducing-Results/m-p/1104980#M80163</link>
      <description>&lt;P&gt;That was it! Thank you&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/53048"&gt;@evaldas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 16:05:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/CRM-Search-API-OR-Logic-Reducing-Results/m-p/1104980#M80163</guid>
      <dc:creator>MJohnson59</dc:creator>
      <dc:date>2025-02-06T16:05:56Z</dc:date>
    </item>
  </channel>
</rss>

