Lookup tables in Hubspot?

New Contributor

Hi there,


I'm trying to mirror a process we have in our ESP within Hubspot and am uncertain how to proceed.


What we woud like to do is look up a value based on a user variable. How we currently do this is by having the system look at a user's profile, search for a variable and match that variable with a value on a lookup table.


So, for example, if we want to customize background color the system looks up a user, finds a value (e.g., ABCD) and then matches that value with a hex value (e.g., #123456) on the lookup table. It then inserts the hex value into the HTML.


The code looks like this:




Does anytone have any experience programming something similar in Hubspot?


Many thanks,



2 Replies 2
HubSpot Moderator

Hi @DougieD,


Did you ever come up with a solution to this? Could you store this as a contact property on your contact records? That way in either a custom module or in the main email body, you could pull the value for the contact you're sending to (or previewing as) with a token like: {{ contact.color_property_name }}. So that token will get transpiled into the actual value. For example if you wrote something like this:


<div bgcolor="{{ contact.color_property_name }}"></div>

...that will transpile into something like (assuming that your contact has a hex code value for that contact property):


<div bgcolor="#ff6347"></div>

I think that would accomplish what you're trying to do. Feel free to follow up here with any questions about it.


Leland Scanlan

HubSpot Developer Support
Regular Contributor

Not the same use case, but I do have the same question: are Lookup Tables on the roadmap?


I have this process where we allocate leads to salespeople around the country based on Postal Code. We don't use the Sales / CRM however. Right now I have this attrocious Workflow with 157183571 branches, that basically goes:


Is your Postal Code one of 1111, 1112, 1113, 1114 .... and 20+ more... 

Yes? Then assign you to region A


Is your Postal Code one of 2111, 2112, 2113, 2114 ... etc.

Yes? Then assign you to region B


Is... and so on


20+ branches in a row, each evaluating a manual list of 20+ zip codes. Horrible to maintain.


I'm looking for a feature where I can upload a .csv or .xlsx (or manually create, for smaller tables) and save it as a globally usable Lookup Table, then tell Hubspot in a workflow: 


Look up the value of Field A in Lookup Table X, then enter the corresponding value in Field B.