<?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: Find number if within set range in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Find-number-if-within-set-range/m-p/1155129#M43091</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/60000"&gt;@ben-duchy&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I think I'd need to see your code to full visualize what you mean but it sounds like an "if in" conditional should do the trick.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% set the_range = range(5, 11) %}

The range:{{the_range}}
&amp;lt;br&amp;gt;
{% set specific_number = 5 %}

{% if specific_number in the_range %}
{{specific_number}} = yahtzee!
{% else %}
{{specific_number}} = womp womp!
{% endif %}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;So you'd be plugging your values into something like that.&lt;BR /&gt;&lt;BR /&gt;Again, without the code in front of me I'm struggling to visualize exactly what you'd plug in where and what sort of for loops you'd need to add, but my guess is it'd be along those lines.&lt;BR /&gt;&lt;BR /&gt;It sounds like you may need some nested loops too if the relevance column needs to loop through other houses.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;HR /&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="profile2022a" style="width: 100px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/71500iE96AB1F9E9E277B9/image-size/small?v=v2&amp;amp;px=200" role="button" title="profile2022a" alt="profile2022a" /&gt;&lt;/span&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Barry Grennan&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;P&gt;&lt;A href="https://www.seoanseo.ca?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Freelance HubSpot CMS Developer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.seoanseo.ca?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Website&lt;/A&gt; | &lt;A href="https://www.seoanseo.ca/#contact?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Contact&lt;/A&gt; | &lt;A href="https://www.linkedin.com/in/barrygrennan" target="_blank" rel="nofollow noopener noreferrer"&gt;LinkedIn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 May 2025 10:04:42 GMT</pubDate>
    <dc:creator>BarryGrennan</dc:creator>
    <dc:date>2025-05-21T10:04:42Z</dc:date>
    <item>
      <title>Find number if within set range</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Find-number-if-within-set-range/m-p/1155089#M43088</link>
      <description>&lt;P&gt;I'm hoping someone can help me with this one as the HubSpot reference on the &lt;A href="https://developers.hubspot.com/docs/reference/cms/hubl/functions#range" target="_blank" rel="noopener"&gt;range function&lt;/A&gt; is a little basic on the details.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a new HubDB table that displays house information and set a basic HubL loop that pulls in all rows, displayed as a HTML table. The first column shows the house name, and the last column displays the SQFT.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to add a new column to display a range based on the SQFT but show 100 either side of it, for example if the SQFT column shows 250, the new column needs to show 150 - 350.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using a simple calculation can do this, but for the next part I'm totally stuck!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From this calculated range, I would like to show a second HTML table that shows each row in the same way as the first table, albeit without the SQFT and range columns, but instead show a relevance column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The relevance column needs to cross reference it's own sqft for example 250, but then only display other house names where 250 is within their range, for example ' The Alderley' has 250 sqft which is within range of The Kensington (200 sqft) and The Warwick (275 sqft) - both of these would be displayed within the relevance column of The Alderley&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2025 08:59:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Find-number-if-within-set-range/m-p/1155089#M43088</guid>
      <dc:creator>ben-duchy</dc:creator>
      <dc:date>2025-05-21T08:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Find number if within set range</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Find-number-if-within-set-range/m-p/1155129#M43091</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/60000"&gt;@ben-duchy&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I think I'd need to see your code to full visualize what you mean but it sounds like an "if in" conditional should do the trick.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% set the_range = range(5, 11) %}

The range:{{the_range}}
&amp;lt;br&amp;gt;
{% set specific_number = 5 %}

{% if specific_number in the_range %}
{{specific_number}} = yahtzee!
{% else %}
{{specific_number}} = womp womp!
{% endif %}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;So you'd be plugging your values into something like that.&lt;BR /&gt;&lt;BR /&gt;Again, without the code in front of me I'm struggling to visualize exactly what you'd plug in where and what sort of for loops you'd need to add, but my guess is it'd be along those lines.&lt;BR /&gt;&lt;BR /&gt;It sounds like you may need some nested loops too if the relevance column needs to loop through other houses.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;HR /&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="profile2022a" style="width: 100px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/71500iE96AB1F9E9E277B9/image-size/small?v=v2&amp;amp;px=200" role="button" title="profile2022a" alt="profile2022a" /&gt;&lt;/span&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Barry Grennan&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;P&gt;&lt;A href="https://www.seoanseo.ca?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Freelance HubSpot CMS Developer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.seoanseo.ca?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Website&lt;/A&gt; | &lt;A href="https://www.seoanseo.ca/#contact?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Contact&lt;/A&gt; | &lt;A href="https://www.linkedin.com/in/barrygrennan" target="_blank" rel="nofollow noopener noreferrer"&gt;LinkedIn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2025 10:04:42 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Find-number-if-within-set-range/m-p/1155129#M43091</guid>
      <dc:creator>BarryGrennan</dc:creator>
      <dc:date>2025-05-21T10:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Find number if within set range</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Find-number-if-within-set-range/m-p/1155176#M43093</link>
      <description>&lt;P&gt;&amp;nbsp;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/146956"&gt;@BarryGrennan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Genius, thank you &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I had to tweak it slightly, but you ultimatley pushed me in the right direction...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{% set house_types = hubdb_table_rows(123456, "&amp;amp;limit=10000") %}
&amp;lt;table&amp;gt;
  &amp;lt;thead&amp;gt;
    &amp;lt;tr&amp;gt;
      &amp;lt;th&amp;gt;Builder&amp;lt;/th&amp;gt;
      &amp;lt;th&amp;gt;House Type&amp;lt;/th&amp;gt;
      &amp;lt;th&amp;gt;SQFT&amp;lt;/th&amp;gt;
      &amp;lt;th&amp;gt;Relevance&amp;lt;/th&amp;gt;
    &amp;lt;/tr&amp;gt;
  &amp;lt;/thead&amp;gt;
  &amp;lt;tbody&amp;gt;
    {% for row in house_types %}
      {% set current_ht = (row.house_type) %}
      {% set minus_sqft = (row.sqft - 100) %}
      {% set plus_sqft = (row.sqft + 100) %}
      {% set the_range = range(minus_sqft, plus_sqft) %}
      &amp;lt;tr&amp;gt;
        &amp;lt;td&amp;gt;{{ row["developer"].name }}&amp;lt;/td&amp;gt;
        &amp;lt;td&amp;gt;{{ row["house_type"] }}&amp;lt;/td&amp;gt;
        &amp;lt;td&amp;gt;{{ row["sqft"] }}&amp;lt;/td&amp;gt;
        &amp;lt;td&amp;gt;
          {% for row in house_types | rejectattr ("house_type","equalto",current_ht) %}
            {% set specific_number = (row.sqft) %}
            {% if specific_number in the_range %}{{ row["house_type"] }}{% endif %}
          {% endfor %}
        &amp;lt;/td&amp;gt;
      &amp;lt;/tr&amp;gt;
    {% endfor %}
  &amp;lt;/tbody&amp;gt;
&amp;lt;/table&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2025 11:44:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Find-number-if-within-set-range/m-p/1155176#M43093</guid>
      <dc:creator>ben-duchy</dc:creator>
      <dc:date>2025-05-21T11:44:27Z</dc:date>
    </item>
  </channel>
</rss>

