<?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: Filter HubDB data based on today's date in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/211698#M8909</link>
    <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/3685"&gt;@jennysowyrda&lt;/a&gt;&amp;nbsp;- I was able to find help in the HubSpot slack group on Friday. Key was to add "&amp;amp;datetime_column__gt=0s" to the query and not use an if statement. Hope that can help someone else!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.hubspot.com/docs/methods/hubdb/v2/get_table_rows" target="_blank"&gt;https://developers.hubspot.com/docs/methods/hubdb/v2/get_table_rows&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Oct 2018 13:23:40 GMT</pubDate>
    <dc:creator>leckerman</dc:creator>
    <dc:date>2018-10-15T13:23:40Z</dc:date>
    <item>
      <title>Filter HubDB data based on today's date</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/24919#M2381</link>
      <description>&lt;P&gt;I am using HubDB to display a list of webinars.&lt;/P&gt;&lt;P&gt;I use the following columns:&lt;/P&gt;&lt;P&gt;event_start_date = start date of the event&lt;/P&gt;&lt;P&gt;event_end_date = end date of the event&lt;/P&gt;&lt;P&gt;landing_page_url = desination URL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I would not like to display past webinars.&lt;/P&gt;&lt;P&gt;So I need to retreive today's date and make sure that only future events are displayed.&lt;/P&gt;&lt;P&gt;Can I filter these in my overview?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current code is below.&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;&lt;PRE&gt;{% set queryparam = "&amp;amp;orderBy=event_start_date" %}

{% set table = hubdb_table_rows(671918, queryparam ) %}
{% if table == [] %}
     &amp;lt;p class='lead'&amp;gt;Sorry, no webinars available.&amp;lt;/p&amp;gt;
{% else %}
     &amp;lt;ul&amp;gt; 
          {% for row in table %}
          &amp;lt;li&amp;gt;
               &amp;lt;h2&amp;gt;&amp;lt;a href="{{ row.landing_page_url }}"&amp;gt;{{ row.hs_name }}&amp;lt;/a&amp;lt;/h2&amp;gt;                      
          &amp;lt;/li&amp;gt;
          {% endfor %}
     &amp;lt;/ul&amp;gt;
{% endif %}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 12:20:05 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/24919#M2381</guid>
      <dc:creator>SvenVanbrabant</dc:creator>
      <dc:date>2017-08-02T12:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Filter HubDB data based on today's date</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/25338#M2400</link>
      <description>&lt;P&gt;Hi Sven,&lt;/P&gt;&lt;P&gt;you must put inside your for cycle this strings:&lt;/P&gt;&lt;P&gt;{% if (row['&lt;SPAN&gt;event_start_date&lt;/SPAN&gt;']|datetimeformat('%j')) &amp;gt;= (local_dt|datetimeformat('%j')) %}&lt;/P&gt;&lt;P&gt;your rows like &amp;lt;li&amp;gt;...&amp;lt;/li&amp;gt;&lt;/P&gt;&lt;P&gt;{% endif %}&lt;/P&gt;&lt;P&gt;note that %j is needed to convert my date (in date format and not datetime) in a timestamp so it's possible to compare two dates&lt;/P&gt;&lt;P&gt;This string hide the past events&lt;/P&gt;&lt;P&gt;I hope this can help you&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Giovanni&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 16:01:58 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/25338#M2400</guid>
      <dc:creator>giozua</dc:creator>
      <dc:date>2017-08-04T16:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Filter HubDB data based on today's date</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/206228#M8189</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/1012"&gt;@giozua&lt;/a&gt;&amp;nbsp;- It appears that string of code works if the event dates are within the same year (ex. past 2018 events don't show up), but any events with dates&amp;nbsp;in the year&amp;nbsp;2017 are showing up in the listing (and shouldn't be). Any idea how to get around this or why this is happening?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my string of code...&lt;/P&gt;&lt;P&gt;{% if (row['event_date_start']|datetimeformat('%j'))&amp;gt;=(local_dt|datetimeformat('%j'))%}&lt;/P&gt;</description>
      <pubDate>Tue, 11 Sep 2018 18:13:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/206228#M8189</guid>
      <dc:creator>leckerman</dc:creator>
      <dc:date>2018-09-11T18:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Filter HubDB data based on today's date</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/210853#M8783</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Can anyone help with this? It appears that new 2019 event dates are not showing up either with that string of code.&amp;nbsp;Please help!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 14:03:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/210853#M8783</guid>
      <dc:creator>leckerman</dc:creator>
      <dc:date>2018-10-09T14:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Filter HubDB data based on today's date</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/211689#M8907</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13654"&gt;@leckerman&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to see if other HubDB users are experiencing this issue&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/19818"&gt;@Jlamb1&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/10872"&gt;@stefan&lt;/a&gt;&amp;nbsp;are you experiencing the same thing? Do you have any tips for&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13654"&gt;@leckerman&lt;/a&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Jenny&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 13:08:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/211689#M8907</guid>
      <dc:creator>jennysowyrda</dc:creator>
      <dc:date>2018-10-15T13:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Filter HubDB data based on today's date</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/211698#M8909</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/3685"&gt;@jennysowyrda&lt;/a&gt;&amp;nbsp;- I was able to find help in the HubSpot slack group on Friday. Key was to add "&amp;amp;datetime_column__gt=0s" to the query and not use an if statement. Hope that can help someone else!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.hubspot.com/docs/methods/hubdb/v2/get_table_rows" target="_blank"&gt;https://developers.hubspot.com/docs/methods/hubdb/v2/get_table_rows&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 13:23:40 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/211698#M8909</guid>
      <dc:creator>leckerman</dc:creator>
      <dc:date>2018-10-15T13:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: Filter HubDB data based on today's date</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/211702#M8910</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{% if (row['event_date_start']|unixtimestamp)&amp;gt;=(local_dt|unixtimestamp)%}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It should work&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Giovanni&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 13:40:45 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/211702#M8910</guid>
      <dc:creator>giozua</dc:creator>
      <dc:date>2018-10-15T13:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Filter HubDB data based on today's date</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/293713#M13737</link>
      <description>&lt;P&gt;Rather than filtering by date in your for loop, it is better to filter the query itself&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{% set queryparam = "&amp;amp;orderBy=start_date" %}&lt;BR /&gt;{% set queryparam = queryparam + "&amp;amp;event_start_date__gt=" + local_dt|unixtimestamp %}&lt;BR /&gt;{% set table = hubdb_table_rows(XXXXXX, queryparam) %}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This helps in scenarios where you might only want to show a limited # of results &amp;gt;= today's date -- say a list of the next 3 upcoming on your homepage, not ALL upcoming.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 16:40:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/293713#M13737</guid>
      <dc:creator>jasonvanpelt</dc:creator>
      <dc:date>2019-09-27T16:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Filter HubDB data based on today's date</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/372421#M18757</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/1012"&gt;@giozua&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;This solution work perfect when we use '%j' in a timestamp but the thing is this condition doesnot show up the events for next year. I mean this condition only shows the events till Dec 31, 2020. If we set the event date for Jan 01, 2021 then, the events are not being displayed in the site. I suppose you get what's the issue I mean.&lt;/P&gt;&lt;P&gt;It would be really a great help if there is any solutions regarding the issue. Thanks in advance!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 07:11:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/372421#M18757</guid>
      <dc:creator>Subinbajra</dc:creator>
      <dc:date>2020-09-22T07:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Filter HubDB data based on today's date</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/418971#M21739</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/66863"&gt;@jasonvanpelt&lt;/a&gt;,&amp;nbsp;so i tried the cod and it works perfectkly. However i am not able to show the events for the next 30 days. How can i add that? Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 08:38:04 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Filter-HubDB-data-based-on-today-s-date/m-p/418971#M21739</guid>
      <dc:creator>fawadsabri</dc:creator>
      <dc:date>2021-03-16T08:38:04Z</dc:date>
    </item>
  </channel>
</rss>

