<?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: Need assistance with correct Hubl code in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Need-assistance-with-correct-Hubl-code/m-p/502906#M25340</link>
    <description>&lt;P&gt;Hey &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13203"&gt;@tmcmillan99&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It might be easier to use request.query_dict. This variable breaks all querys into a dictionery thats much easier to use.&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 the_query = request.query_dict %}

{% set dealer = the_query.id %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With this method you can also handle situations when the query isn't present.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% if !the_query.id %}
  Somthing went wrong
{% endif %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Sep 2021 18:16:06 GMT</pubDate>
    <dc:creator>Kevin-C</dc:creator>
    <dc:date>2021-09-29T18:16:06Z</dc:date>
    <item>
      <title>Need assistance with correct Hubl code</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Need-assistance-with-correct-Hubl-code/m-p/502760#M25333</link>
      <description>&lt;P&gt;I need some assistance in determining the correct Hubl code for my scenario below. I am trying to grab part of a request query to use as the customer id in order to pull data from a HubDB table. The code was working correctly but I believe I broke it when adding an additonal parameter (assigned_dealer_v2=) to the requst query to be used in a hidden form field.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example Request Query from the URL-&lt;/P&gt;
&lt;P&gt;/dealer?assigned_dealer_v2=Indeco%20Sales&amp;amp;id=00010928-tx&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My Hubl Code-&lt;/P&gt;
&lt;P&gt;{% set dealer = '{{ request.query|split("=")|last|trim }}' %}&lt;BR /&gt;{% set dealerval = dealer|render %}&lt;BR /&gt;{% for row in hubdb_table_rows(5241455, 'customerid='~dealerval) %}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using the example request query above, I am trying to pull the string after the last "=" sign -&amp;nbsp;00010928-tx&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas on what I have set up wrong?&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>Wed, 29 Sep 2021 15:23:43 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Need-assistance-with-correct-Hubl-code/m-p/502760#M25333</guid>
      <dc:creator>tmcmillan99</dc:creator>
      <dc:date>2021-09-29T15:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need assistance with correct Hubl code</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Need-assistance-with-correct-Hubl-code/m-p/502823#M25336</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13203"&gt;@tmcmillan99&lt;/a&gt;&amp;nbsp;, can you output the dealer id with a &lt;CODE&gt;{{dealerval}}&lt;/CODE&gt; so that we can see that the correct value is pulled off the request query?&lt;BR /&gt;I used your exact code and it does indeed pull the "00010928-tx" value.&lt;BR /&gt;Maybe the issue is with the hubdb.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 16:10:43 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Need-assistance-with-correct-Hubl-code/m-p/502823#M25336</guid>
      <dc:creator>miljkovicmisa</dc:creator>
      <dc:date>2021-09-29T16:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need assistance with correct Hubl code</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Need-assistance-with-correct-Hubl-code/m-p/502827#M25337</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/166093"&gt;@miljkovicmisa&lt;/a&gt;&amp;nbsp;Thanks for the reply back and confirmation that the code is working as it should. I have not looked at the HubDB table yet. It was recently updated by the client so that will definitely be my next step.&lt;/P&gt;
&lt;P&gt;Thanks for the assistance.&lt;/P&gt;
&lt;P&gt;Terry&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 16:16:15 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Need-assistance-with-correct-Hubl-code/m-p/502827#M25337</guid>
      <dc:creator>tmcmillan99</dc:creator>
      <dc:date>2021-09-29T16:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Need assistance with correct Hubl code</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Need-assistance-with-correct-Hubl-code/m-p/502906#M25340</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13203"&gt;@tmcmillan99&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It might be easier to use request.query_dict. This variable breaks all querys into a dictionery thats much easier to use.&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 the_query = request.query_dict %}

{% set dealer = the_query.id %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With this method you can also handle situations when the query isn't present.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% if !the_query.id %}
  Somthing went wrong
{% endif %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 18:16:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Need-assistance-with-correct-Hubl-code/m-p/502906#M25340</guid>
      <dc:creator>Kevin-C</dc:creator>
      <dc:date>2021-09-29T18:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need assistance with correct Hubl code</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Need-assistance-with-correct-Hubl-code/m-p/502907#M25341</link>
      <description>&lt;P&gt;Awesome&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/73772"&gt;@Kevin-C&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;Thanks for the suggestion! I have not seen that variable before so I will definitely look into more.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 18:22:34 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Need-assistance-with-correct-Hubl-code/m-p/502907#M25341</guid>
      <dc:creator>tmcmillan99</dc:creator>
      <dc:date>2021-09-29T18:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need assistance with correct Hubl code</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Need-assistance-with-correct-Hubl-code/m-p/503089#M25342</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Update&lt;/STRONG&gt; - I have still not been able to get it to work correctly. I am sure it's going to be something simple. I changed up the code a bit to make it easier to see what value is being rendered if I output it to the page.&lt;/P&gt;
&lt;P&gt;New Code-&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% set dealer = '{{ request.query|split("=")|last|trim }}' %}
{% set dealerval = 'customerid='~dealer|render %}
{% for row in hubdb_table_rows(5241455, dealerval) %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I output {{ dealerval }} on the page, it shows a value of 'customerid=&lt;SPAN&gt;00010928-tx' which is correct and should filter the table to those rows that match.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If I manually input the info for dealerval as such:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% set dealerval ='customerid=00010928-tx' %}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;Everything works correctly and it pulls the appropriate info from the row and displays it on the page.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Any additional thoughts or suggestions would be greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Terry&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 01:25:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Need-assistance-with-correct-Hubl-code/m-p/503089#M25342</guid>
      <dc:creator>tmcmillan99</dc:creator>
      <dc:date>2021-09-30T01:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need assistance with correct Hubl code</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Need-assistance-with-correct-Hubl-code/m-p/503254#M25347</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13203"&gt;@tmcmillan99&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your first line setting and assigning the dealer variable is invalid. Remove the quotation marks and remove the brackets. It should be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% set dealer = request.query|split("=")|last|trim %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 11:42:28 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Need-assistance-with-correct-Hubl-code/m-p/503254#M25347</guid>
      <dc:creator>piersg</dc:creator>
      <dc:date>2021-09-30T11:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need assistance with correct Hubl code</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Need-assistance-with-correct-Hubl-code/m-p/503367#M25355</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/103660"&gt;@piersg&lt;/a&gt;&amp;nbsp;That was the issue! Thanks so much for the suggestion. The issue is resolved and the data is displaying correctly now. Much appreciated.&lt;/P&gt;
&lt;P&gt;Terry&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 13:24:38 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Need-assistance-with-correct-Hubl-code/m-p/503367#M25355</guid>
      <dc:creator>tmcmillan99</dc:creator>
      <dc:date>2021-09-30T13:24:38Z</dc:date>
    </item>
  </channel>
</rss>

