CMS Development

jonflynnh2o
Participant | Partner
Participant | Partner

Passing hubdb foreign ID response into custom module using HubDB row field

SOLVE

We have a custom module using the new HubDB row as a field. As part of a dynamic page template, we're grabbing some rows from a hubdb table using the foreign ID field and then attempting to pass it into the module in hopes it will fill the hubdb row field, like so:

 

{% module "services" path="../modules/U3M Reusable HubDB Page Card", 
service_picker={{ dynamic_page_hubdb_row.services_offered }} %}

 

 

The 'service_picker' is the hubdb row field within the module and what we're trying to pass through is the response from the hubdb foreign ID field. Both fields give a different hubl dictionary in the response so this doesn't work, how could we manipulate the response so they can be compatible with each other?

0 Upvotes
1 Accepted solution
jonflynnh2o
Solution
Participant | Partner
Participant | Partner

Passing hubdb foreign ID response into custom module using HubDB row field

SOLVE

I ended up creating a dummy hubdb table field inside the module and passing in the foreign IDs via that. However, not really ideal, I also mutated the foreign ID dictionary to be identical to that of the response of the hubdb rows and it still did not accept it.

View solution in original post

0 Upvotes
3 Replies 3
CP-BWG
Contributor

Passing hubdb foreign ID response into custom module using HubDB row field

SOLVE

@jonflynnh2o @dennisedson 

 

Here's the solution you're looking for.  We found your post trying to do the exact same thing, and our dude's figure it out:

 

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 a foreign key:

 

hubDB_row_selection_field_being_passed_to_custom_module={id={{hubDB_foreign_key_field_in_table.hs_id}}}

 

 

dennisedson
HubSpot Product Team
HubSpot Product Team

Passing hubdb foreign ID response into custom module using HubDB row field

SOLVE

@kierana , @Kevin-C  any thoughts here?

jonflynnh2o
Solution
Participant | Partner
Participant | Partner

Passing hubdb foreign ID response into custom module using HubDB row field

SOLVE

I ended up creating a dummy hubdb table field inside the module and passing in the foreign IDs via that. However, not really ideal, I also mutated the foreign ID dictionary to be identical to that of the response of the hubdb rows and it still did not accept it.

0 Upvotes