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
{% set menuLink_descs = {} %} {% for row in hubdb_table_rows(3418393) %} {% set key1 = row.name|string %} {% set val1 = row.description|truncatehtml(100,'', false)|safe|string %} {% set stupid = menuLink_descs.update({key1:val1}) %} {% endfor %}
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.
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?