<?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 Help with Filtering for Programmable Email in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Help-with-Filtering-for-Programmable-Email/m-p/638135#M28850</link>
    <description>&lt;P&gt;So I'm looking to build an email that dynamically pulls in resources from a HubDB table. The table contains the following columns:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;resource_url&lt;/LI&gt;&lt;LI&gt;resource_type&lt;/LI&gt;&lt;LI&gt;content_bucket&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;So if someone downloads a resource, we want to send them an email suggesting related resources, but &lt;STRONG&gt;excluding&lt;/STRONG&gt; the one they downloaded. I'm looking for help with two things.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, I can't get the query parameters to work correctly. I can pull in data if I hard code the query, but I need the query to dynamically pull in values from the &lt;STRONG&gt;other&lt;/STRONG&gt; rows containing the same resource_type and content_bucket.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Relatedly, I also I need to exlcude the row containing the value or the resource_url the contact has already downloaded.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;We'll store that value in it's own propety on the contact record, so I can call it in like {% set initial_resource = contact.first_download_url %}.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Here's what I have:&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;{% set initial_resource = contact.first_download_url.value %}
    {% if initial_resource is containing row.resource_url %}
    {% set resource_id = row.resource_type.id %}
    {% set content_bucket_id = row.content_bucket.id %}
      &amp;lt;h3&amp;gt;Available Resources&amp;lt;/h3&amp;gt;
      &amp;lt;ul&amp;gt;
&amp;lt;!--note that this line is commented out but included for reference--&amp;gt;{# for rows in hubdb_table_rows(&amp;lt;table_id&amp;gt;, "resource_type=2&amp;amp;content_bucket=2&amp;amp;orderBy=count") #}
      {% for row.resource_url in hubdb_table_rows(&amp;lt;id&amp;gt;, "resource_type="~resource_id~"&amp;amp;content_bucket="~content_bucket_id~"&amp;amp;orderBy=order") %}
          &amp;lt;li&amp;gt;{{ resource_id }}&amp;lt;/li&amp;gt;
      {% endfor %}
      &amp;lt;/ul&amp;gt;
      {% else %}
      evaluated to false
    {% endif %}&lt;/LI-CODE&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Making this work would be kind of a dream come true, so thanks in advance!&lt;/P&gt;</description>
    <pubDate>Wed, 25 May 2022 14:15:32 GMT</pubDate>
    <dc:creator>CFrench</dc:creator>
    <dc:date>2022-05-25T14:15:32Z</dc:date>
  </channel>
</rss>

