How to get all options from a select field from HubDB from within a module?

Lets use an example to make it easier to understand

I have a list in hubdb. Each item in that list has a property called type which is then selected from the select list. Lets say it can be “Type A”, “Type B” and “Type C”. These are then intended to be filtered based on the type in a custom module I’ve created. I could create three buttons that will sort this with hardcoded type values.

The problem comes when this exact module are to be used with items in another list that has the types “Type D”, “Type E” and “Type F”.

How can i retrieve all possible options from this select?

Hi @LBenediktson ,

You can use the hubdb_table_column function for this. You can simply pass it the Table ID and the Column ID (or name) and you can then access the options:

{% set column_info = hubdb_table_column(<tableID>, <columnID>) %} 
{{ column_info.options|pprinnt }}