I have questions or charts in metabase which are using filters. These filters have foreign keys pointing at foreign tables where they have a field name which describes the ID that these filters point to. So for a chart displaying shs_people which has a shool_id, I want the filter school_id, but what I need to show in the otions is shs_school.name where school_people.shool_id = shs_school.id
That all works ok, I can see the list of school names in the dropdowns of individual chart or questions e.g.
The problem is when I create a dashboard with two charts with the same filters. I create a filter called school and I link it to the filter school of each chart. In that case, the dropdown in the dashboard is showing IDs instead of the school names. But as you can see in the previous screenshot, the filters do show the school names.
Iâve the same situation,
Filter show properly ânameâ and âidâ in the card, but don't work when connecting with Filter Dashboard (only show âidâ)
This is an explanation of how to get Entity Key/Name mapping working for a single table. This does not cover mappings through a foreign key.
Entity Key/Name mapping is only supported on select databases (notably, it does NOT work on H2, so you canât do this on Sample Database). This procedure was tested on PostgreSQL.
Make sure the table metadata is set properly:
ID column should be semantic type âEntity Keyâ
name column should be semantic type âEntity Nameâ
Behavior â Filtering for the Entity Key column must be set to âA list of all valuesâ
If everything is set up right, under âDisplay Valuesâ for the Entity Key, the âCustom Mappingâ option will be available. (You donât have to select it, but the filtering setup must fulfill the requirements for Custom Mapping to be available for the key/name mapping to function.)
In the dashboard, the filter:
Must be Filter or Parameter Type âIDâ
Must be attached to the column marked as Entity Key
If all done correctly, pulling down the ID filter will display the Entity Name text followed by the ID field text/number.
If the Entity Name field doesnât qualify for the âList of all valuesâ filter type (due to too many values or too wide), then you wonât get the list.