<?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: Choice field / select a row from HubDB list within a custom module in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/406545#M20957</link>
    <description>&lt;P&gt;No, sadly not. An alternative version of above I use is using the query param.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% set db = module.content.db %}
{% set search = module.search %}
{% set queryparam = '&amp;amp;orderBy=order' %}
{% set rows = hubdb_table_rows(db, queryparam) %}

{% if search %}
  {% set queryparam = queryparam~"&amp;amp;name__contains="~search %}
{% endif %}

{# Loop through array #}
{% for row in rows %}
  {{ row.name }}
{% endfor %}&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 05 Feb 2021 08:40:41 GMT</pubDate>
    <dc:creator>Indra</dc:creator>
    <dc:date>2021-02-05T08:40:41Z</dc:date>
    <item>
      <title>Choice field / select a row from HubDB list within a custom module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/358812#M17813</link>
      <description>&lt;P&gt;Is there a way to let the user select an row from a HubDB to select 1 item inside a custom module?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't want the user to copy and past the row ID and make it more simple by letting them select an row from a choice field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have seen the following sollution:&amp;nbsp;&lt;BR /&gt;&lt;A href="https://community.hubspot.com/t5/CMS-Development/Pulling-a-hubdb-column-in-as-a-choice-dropdown/td-p/2267" target="_blank" rel="noopener"&gt;https://community.hubspot.com/t5/CMS-Development/Pulling-a-hubdb-column-in-as-a-choice-dropdown/td-p/2267&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This will not work since "export_to_template_context=True" does not work with a custom module.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think there should be a new field to select a row from a selected hubdb to extract data from that row.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 14:11:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/358812#M17813</guid>
      <dc:creator>Indra</dc:creator>
      <dc:date>2020-07-31T14:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Choice field / select a row from HubDB list within a custom module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/358820#M17814</link>
      <description>&lt;P&gt;Hi Indra,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If I understand correctly, could you not do something like this?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&amp;lt;select&amp;gt;
{% for row in hubdb_table_rows(&amp;lt;tableId or name&amp;gt;, &amp;lt;filterQuery&amp;gt;) %}
&amp;lt;option value="{{ row.hs_id }}"&amp;gt;{{ row.&amp;lt;column name&amp;gt; }}&amp;lt;/option&amp;gt;
{% endfor %}
&amp;lt;/select&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;This would give them a select dropdown of all the rows and then you can continue to do it as though they input the ID themselves? (Which ever way you're doing that)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Unless you need this inside the menu on the edit screen in which case, this wouldn't work of course&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Sandy&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 14:32:33 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/358820#M17814</guid>
      <dc:creator>SandyG1</dc:creator>
      <dc:date>2020-07-31T14:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Choice field / select a row from HubDB list within a custom module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/358828#M17816</link>
      <description>&lt;P&gt;Hi SandyG1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's not for the front-end (visitor) to select an item. It is for the person who created the website/page and for them to select just one row from the HubDB inside a custom module.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for thinking out loud.&lt;/P&gt;&lt;P&gt;Indra&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 14:35:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/358828#M17816</guid>
      <dc:creator>Indra</dc:creator>
      <dc:date>2020-07-31T14:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Choice field / select a row from HubDB list within a custom module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/378915#M19121</link>
      <description>&lt;P&gt;Hey, did you manage to get it working? I`m searching for the same solution to choose from a testimonial in a table.&lt;BR /&gt;&lt;BR /&gt;Would be amazing. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Mike&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 08:28:31 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/378915#M19121</guid>
      <dc:creator>MikeBeatwoot</dc:creator>
      <dc:date>2020-10-15T08:28:31Z</dc:date>
    </item>
    <item>
      <title>Betreff: Choice field / select a row from HubDB list within a custom module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/378924#M19122</link>
      <description>&lt;P&gt;Need the same Feature for a products table &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; Solutions are very welcome-&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 09:12:55 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/378924#M19122</guid>
      <dc:creator>Schascha</dc:creator>
      <dc:date>2020-10-15T09:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: Choice field / select a row from HubDB list within a custom module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/379242#M19146</link>
      <description>&lt;P&gt;No. Sadly not. Had to create two fields where one let the user select a hubDB and one with a search field so you can search by a row. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{# Text field #}&lt;BR /&gt;{% set search = module.content.search %}&lt;BR /&gt;{# HubDB field #}
{% set db = module.content.db %}&lt;BR /&gt;{# Creat array of employees #}
{% set employees_list = hubdb_table_rows(db) %}&lt;BR /&gt;{# Creat filtered array of employees by the search term #}
{% set employees = employees_list|selectattr('fullname', 'equalto', search) %}
&lt;BR /&gt;{# Loop through array #}
{% for employee in employees %}
      {{ employee.fullname }}
{% endfor %}&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Oct 2020 05:56:11 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/379242#M19146</guid>
      <dc:creator>Indra</dc:creator>
      <dc:date>2020-10-16T05:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Choice field / select a row from HubDB list within a custom module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/403992#M20782</link>
      <description>&lt;P&gt;Idra, did you manage to get it working? I`m searching for the same solution but no luck finding it in the community docs&lt;BR /&gt;&lt;BR /&gt;Greets Eelko&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 08:00:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/403992#M20782</guid>
      <dc:creator>Eelko</dc:creator>
      <dc:date>2021-01-28T08:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Choice field / select a row from HubDB list within a custom module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/406545#M20957</link>
      <description>&lt;P&gt;No, sadly not. An alternative version of above I use is using the query param.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% set db = module.content.db %}
{% set search = module.search %}
{% set queryparam = '&amp;amp;orderBy=order' %}
{% set rows = hubdb_table_rows(db, queryparam) %}

{% if search %}
  {% set queryparam = queryparam~"&amp;amp;name__contains="~search %}
{% endif %}

{# Loop through array #}
{% for row in rows %}
  {{ row.name }}
{% endfor %}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 05 Feb 2021 08:40:41 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/406545#M20957</guid>
      <dc:creator>Indra</dc:creator>
      <dc:date>2021-02-05T08:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Choice field / select a row from HubDB list within a custom module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/406884#M20988</link>
      <description>&lt;P&gt;Hubspot just released yesterday a HubDB Row field in Custom Modules. Available to Marketing Hub Professional &amp;amp; Enterprise customers, as well as all CMS Hub Professional &amp;amp; Enterprise customers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.hubspot.com/product-updates/easily-leverage-hubdb-with-the-new-hubdb-row-field" target="_blank" rel="noopener"&gt;https://www.hubspot.com/product-updates/easily-leverage-hubdb-with-the-new-hubdb-row-field&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 23:59:04 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/406884#M20988</guid>
      <dc:creator>alyssamwilie</dc:creator>
      <dc:date>2021-02-05T23:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Choice field / select a row from HubDB list within a custom module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/408276#M21086</link>
      <description>&lt;P&gt;This is game changing! Super powerful &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; thanks for sharing this&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/91608"&gt;@alyssamwilie&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 09:15:47 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/408276#M21086</guid>
      <dc:creator>SandyG1</dc:creator>
      <dc:date>2021-02-11T09:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: Choice field / select a row from HubDB list within a custom module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/524973#M26096</link>
      <description>&lt;P&gt;If you are using a module that has a HubDB row field in it, and then try to programmatically pass a selection from that field inside the module itself, you will likely struggle to figure out how to reference the selection of a hubDB row.&amp;nbsp; Why?&amp;nbsp; Because the &lt;A href="https://developers.hubspot.com/en/docs/cms/building-blocks/modules/using-modules-in-templates" target="_blank" rel="noopener"&gt;page that shows how to reference fields inside module&lt;/A&gt;s has every other conceivable field other than a HubDB Row.&amp;nbsp; Has the UbDB Table, but not a row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's how you pass a hubDB row field selection inside a module that is referencing a table using foreign key:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;hubDB_row_selection_field_being_passed_to_custom_module={id={{hubDB_foreign_key_field_in_table.hs_id}}}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 20:34:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Choice-field-select-a-row-from-HubDB-list-within-a-custom-module/m-p/524973#M26096</guid>
      <dc:creator>CP-BWG</dc:creator>
      <dc:date>2021-11-11T20:34:08Z</dc:date>
    </item>
  </channel>
</rss>

