Choice field / select a row from HubDB list within a custom module
lösung
Hubspot just released yesterday a HubDB Row field in Custom Modules. Available to Marketing Hub Professional & Enterprise customers, as well as all CMS Hub Professional & Enterprise customers.
Choice field / select a row from HubDB list within a custom module
lösung
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. Why? Because the page that shows how to reference fields inside modules has every other conceivable field other than a HubDB Row. Has the UbDB Table, but not a row.
Here's how you pass a hubDB row field selection inside a module that is referencing a table using foreign key:
Choice field / select a row from HubDB list within a custom module
lösung
Hubspot just released yesterday a HubDB Row field in Custom Modules. Available to Marketing Hub Professional & Enterprise customers, as well as all CMS Hub Professional & Enterprise customers.
Choice field / select a row from HubDB list within a custom module
lösung
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:
{# Text field #} {% set search = module.content.search %} {# HubDB field #}
{% set db = module.content.db %} {# Creat array of employees #}
{% set employees_list = hubdb_table_rows(db) %} {# Creat filtered array of employees by the search term #}
{% set employees = employees_list|selectattr('fullname', 'equalto', search) %}
{# Loop through array #}
{% for employee in employees %}
{{ employee.fullname }}
{% endfor %}
Jul 31, 202010:24 AM - bearbeitet Jul 31, 202010:32 AM
Mitwirkender/Mitwirkende | Partner
Choice field / select a row from HubDB list within a custom module
lösung
Hi Indra,
If I understand correctly, could you not do something like this?
<select>
{% for row in hubdb_table_rows(<tableId or name>, <filterQuery>) %}
<option value="{{ row.hs_id }}">{{ row.<column name> }}</option>
{% endfor %}
</select>
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)
Unless you need this inside the menu on the edit screen in which case, this wouldn't work of course
Choice field / select a row from HubDB list within a custom module
lösung
Hi SandyG1,
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.