While data types indicate to a database how it should interpret the values in a field, field types or semantic types describe the meaning of a field. For example, a column’s data type could be
type/text but the semantic type may be Email. Field types are just one example of metadata—information about data—that Admins can change in Metabase.
Field types dictate how Metabase displays its data, as well as the column’s special functionality, if any. By marking columns in a table as Latitude and Longitude, Metabase can use the columns to create pin and heat maps. Similarly, designating a column as a URL allows users to click on the link to visit that URL.
List of Metabase Field Types
Metabase recognizes the following field types:
- Overall Row
- Entity Key – The field in this table that uniquely identifies each row. Could be a product ID, serial number, etc.
- Entity Name – Different from the entity key, the entity name represents what each row in the table is. For example, in a Users table, the User column might be the entity name.
- Foreign Key – The column in this table that (usually) refers to the primary key of another table in order to connect data from different tables that are related. For example, in a Products table, you might have a Customer ID field that points to a Customers table, where Customer ID is the primary key.
- Zip Code
- Gross margin
- Date and Time
- Cancelation date
- Cancelation time
- Cancelation timestamp
- Creation date
- Creation time
- Creation timestamp
- Deletion date
- Deletion time
- Deletion timestamp
- Updated date
- Updated time
- Updated timestamp
- Join date
- Join time
- Join timestamp
- UNIX Timestamp (Milliseconds)
- UNIX Timestamp (Seconds)
- Enum - An abbreviation for “enumerated type,” the value of an enum draws on a predefined list of options. An example of an enum would be a field for the months of the year. This list of twelve options is defined in makeup of the column, and no options outside this list would be valid.
- Avatar Image URL
- Image URL
- Field containing JSON
- No semantic type – Used for fields that don’t fall into any of the above field types.
Using field types in Metabase
Fields types in models
You can set field types for models, which helps Metabase understand how to work with data in models built using SQL. You can also configure text fields in models to surface individual records in search.
When you X-ray a table or model, Metabase considers both the data type and the field type to display different charts that summarize that data.
Editing types in the Table Metadata page
If you’re an administrator, you can edit field types using the Table Metadata page in the Admin Panel.
While data types themselves can’t be edited in Metabase, admins can manually cast data types to be read differently, like interpreting a numerical data type as a date format.