<?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 updating dict with hubdb row value in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/updating-dict-with-hubdb-row-value/m-p/407829#M21052</link>
    <description>&lt;P&gt;I can't seem to find any documentation on how to convert a hubdb row value to a string that's suitable for the dictionary update function. It takes strings but nothing is working. Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{% set menuLink_descs = {} %}&lt;BR /&gt;{% for row in hubdb_table_rows(3418393) %}&lt;BR /&gt;{% set key1 = row.name|string %}&lt;BR /&gt;{% set val1 = row.description|truncatehtml(100,'', false)|safe|string %}&lt;BR /&gt;{% set stupid = menuLink_descs.update({key1:val1}) %}&lt;BR /&gt;{% endfor %}&lt;/P&gt;</description>
    <pubDate>Wed, 10 Feb 2021 03:44:58 GMT</pubDate>
    <dc:creator>kyl3</dc:creator>
    <dc:date>2021-02-10T03:44:58Z</dc:date>
    <item>
      <title>updating dict with hubdb row value</title>
      <link>https://community.hubspot.com/t5/CMS-Development/updating-dict-with-hubdb-row-value/m-p/407829#M21052</link>
      <description>&lt;P&gt;I can't seem to find any documentation on how to convert a hubdb row value to a string that's suitable for the dictionary update function. It takes strings but nothing is working. Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{% set menuLink_descs = {} %}&lt;BR /&gt;{% for row in hubdb_table_rows(3418393) %}&lt;BR /&gt;{% set key1 = row.name|string %}&lt;BR /&gt;{% set val1 = row.description|truncatehtml(100,'', false)|safe|string %}&lt;BR /&gt;{% set stupid = menuLink_descs.update({key1:val1}) %}&lt;BR /&gt;{% endfor %}&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 03:44:58 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/updating-dict-with-hubdb-row-value/m-p/407829#M21052</guid>
      <dc:creator>kyl3</dc:creator>
      <dc:date>2021-02-10T03:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: updating dict with hubdb row value</title>
      <link>https://community.hubspot.com/t5/CMS-Development/updating-dict-with-hubdb-row-value/m-p/408043#M21060</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/102800"&gt;@kyl3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you can't dynamically set dict keys in Hubl.&lt;/P&gt;
&lt;P&gt;Looking at your attempt leads me to wonder what you're trying to do with this dict?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming you wont necessarily know the keys because they're dynamically created, maybe a list/array is a better fit?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% set menuLink_descsdescs = [] %}

{% for row in hubdb_table_rows(3405985) %}
  {% do menuLink_descsdescs.append([row.name, row.description|truncatehtml(100,'', false)|safe|string]) %}
{% endfor %}
		
{{ menuLink_descsdescs }}&lt;/LI-CODE&gt;
&lt;P&gt;Now you can loop through you objects and reference your them with bracket notation!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure if that helps at all but I hope so!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 16:42:19 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/updating-dict-with-hubdb-row-value/m-p/408043#M21060</guid>
      <dc:creator>Kevin-C</dc:creator>
      <dc:date>2021-02-10T16:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: updating dict with hubdb row value</title>
      <link>https://community.hubspot.com/t5/CMS-Development/updating-dict-with-hubdb-row-value/m-p/408084#M21067</link>
      <description>&lt;P&gt;I was needing to add a mega menu with text attached to a menu item and put them in hubdb. Wanting a quick lookup through a dict (associative array type) with it being 'link name:description' but sadly hubspot doesn't utilize this dynamically which I thought was possible in python. Is this a security measure? Seems to be a valuable tool to add eventually.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 17:48:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/updating-dict-with-hubdb-row-value/m-p/408084#M21067</guid>
      <dc:creator>kyl3</dc:creator>
      <dc:date>2021-02-10T17:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: updating dict with hubdb row value</title>
      <link>https://community.hubspot.com/t5/CMS-Development/updating-dict-with-hubdb-row-value/m-p/408092#M21070</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/102800"&gt;@kyl3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have done exactly this using the method above! But rather than attach the mega-menu to the menu-items I just built the whole menu in HubDB. Might be worth a shot?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 18:09:13 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/updating-dict-with-hubdb-row-value/m-p/408092#M21070</guid>
      <dc:creator>Kevin-C</dc:creator>
      <dc:date>2021-02-10T18:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: updating dict with hubdb row value</title>
      <link>https://community.hubspot.com/t5/CMS-Development/updating-dict-with-hubdb-row-value/m-p/408431#M21107</link>
      <description>&lt;P&gt;After sleeping on it, I'm pretty positive you could merge the data using hubl.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe using the navigation menu text as a relational id and match it against a column in the HubDB?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I get a chance today I'll try to explore this option!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 14:40:59 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/updating-dict-with-hubdb-row-value/m-p/408431#M21107</guid>
      <dc:creator>Kevin-C</dc:creator>
      <dc:date>2021-02-11T14:40:59Z</dc:date>
    </item>
  </channel>
</rss>

