<?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: Convert url parameter string to integer in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Convert-url-parameter-string-to-integer/m-p/444817#M23536</link>
    <description>&lt;P&gt;I figured out. In case anyone is interested, here is the code that works-&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    {% set dealer = '{{ request.query|split("=")|last|trim }}' %}
    {% set dealerval = dealer|render %}
    {% for row in hubdb_table_rows(5241455, 'customerid='~dealerval) %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Terry&lt;/P&gt;</description>
    <pubDate>Mon, 07 Jun 2021 21:45:31 GMT</pubDate>
    <dc:creator>tmcmillan99</dc:creator>
    <dc:date>2021-06-07T21:45:31Z</dc:date>
    <item>
      <title>Convert url parameter string to integer</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Convert-url-parameter-string-to-integer/m-p/443784#M23457</link>
      <description>&lt;P&gt;I am trying to convert a url parameter to an integer and not having any luck with the correct syntax. The code below shows as an error.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    {% set dealer = '{{ request.query|split("=")|last }}' %}
    {% set filterquery = dealer|int %}
    {% set row = hubdb_table_row(5241455, filterquery) %}&lt;/LI-CODE&gt;
&lt;P&gt;The first line works correctly. I believe the issue is with the second line when I set the filterquery.&lt;/P&gt;
&lt;P&gt;Scenario-&lt;/P&gt;
&lt;P&gt;I am passing a HubDB row id from another page as a url parameter.&lt;/P&gt;
&lt;P&gt;Example -&amp;nbsp;/dealer?id=47948622379&lt;/P&gt;
&lt;P&gt;The dealer line above extracts the row id correctly but is a string at this point. Since the row id is an integer in the HubDB table, I am trying to convert it so that my&amp;nbsp;hubdb_table_row line reads it correctly and renders the info from the table that I need.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I render {{ dealer|int }} on my page, I know it's not converting because it returns a 0.&lt;/P&gt;
&lt;P&gt;Any assistance would be greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Terry McMillan&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jun 2021 14:35:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Convert-url-parameter-string-to-integer/m-p/443784#M23457</guid>
      <dc:creator>tmcmillan99</dc:creator>
      <dc:date>2021-06-03T14:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Convert url parameter string to integer</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Convert-url-parameter-string-to-integer/m-p/443860#M23464</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt; , any advice you can add here?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jun 2021 18:01:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Convert-url-parameter-string-to-integer/m-p/443860#M23464</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2021-06-03T18:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: Convert url parameter string to integer</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Convert-url-parameter-string-to-integer/m-p/444338#M23504</link>
      <description>&lt;P&gt;Does anyone have any ideas? I was thinking this was probably a syntax issue and wouldn't be too difficult to resolve.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Option B&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pass the customerid field in the url parameter since it's a text field.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I tell it to use the "dealer" variable as the value for the customerid column when setting the row?&lt;/P&gt;
&lt;P&gt;Something like this code (that doesn't work)-&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    {% set dealer = '{{ request.query|split("=")|last }}' %}
    {% set row = hubdb_table_rows(5241455, 'customerid=dealer') %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Terry&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 21:25:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Convert-url-parameter-string-to-integer/m-p/444338#M23504</guid>
      <dc:creator>tmcmillan99</dc:creator>
      <dc:date>2021-06-04T21:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: Convert url parameter string to integer</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Convert-url-parameter-string-to-integer/m-p/444682#M23531</link>
      <description>&lt;P&gt;Maybe &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/91608"&gt;@alyssamwilie&lt;/a&gt; can help out &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jun 2021 14:50:46 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Convert-url-parameter-string-to-integer/m-p/444682#M23531</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2021-06-07T14:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Convert url parameter string to integer</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Convert-url-parameter-string-to-integer/m-p/444791#M23535</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13982"&gt;@dennisedson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Getting closer on a solution but still need help on syntax.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following code does not work:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    {% set dealer = '{{ request.query|split("=")|last|trim }}' %}
    {% set filterquery = "'"~'customerid='~dealer~"'" %}
    {% for row in hubdb_table_rows(5241455, filterquery) %}&lt;/LI-CODE&gt;
&lt;P&gt;The "set filterquery" line produces the following value -&amp;nbsp;&lt;SPAN&gt;'customerid=01002827-al'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If I copy/paste that value in the hubdb_table_rows line as such:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% for row in hubdb_table_rows(5241455, 'customerid=01002827-al') %}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;It works.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;What am I missing in the top code that is causing it not to recognize the filterquery value the same as the actual value?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have wasted a ton of time on this and really need to get it resolved. Again, I feel like this should be pretty straight forward and I just can't find the correct syntax.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Terry&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jun 2021 19:32:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Convert-url-parameter-string-to-integer/m-p/444791#M23535</guid>
      <dc:creator>tmcmillan99</dc:creator>
      <dc:date>2021-06-07T19:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Convert url parameter string to integer</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Convert-url-parameter-string-to-integer/m-p/444817#M23536</link>
      <description>&lt;P&gt;I figured out. In case anyone is interested, here is the code that works-&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    {% set dealer = '{{ request.query|split("=")|last|trim }}' %}
    {% set dealerval = dealer|render %}
    {% for row in hubdb_table_rows(5241455, 'customerid='~dealerval) %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Terry&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jun 2021 21:45:31 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Convert-url-parameter-string-to-integer/m-p/444817#M23536</guid>
      <dc:creator>tmcmillan99</dc:creator>
      <dc:date>2021-06-07T21:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Convert url parameter string to integer</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Convert-url-parameter-string-to-integer/m-p/445134#M23545</link>
      <description>&lt;P&gt;Love the persistence!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 16:51:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Convert-url-parameter-string-to-integer/m-p/445134#M23545</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2021-06-08T16:51:29Z</dc:date>
    </item>
  </channel>
</rss>

