Here is everything i see in the JSON object minus the fields with sensitive info
@BrettJohnson
Pretty sure youâre not looking at the /api/field/X
request.
The /api/field/X/values
request will not have any meta data, but just the values for the dropdown.
Yeah that is not the field api request, that is the JSON object that i posted earlier. I will get those field requests once i get it to work. The reason i believe it to be a caching or syncing issue is the dropdowns seem to be working every 30 mins or so then they stop working after a minute or so.
@BrettJohnson
But if it has something to do with sync, then check your sync settings. And you should see something in the logs.
@BrettJohnson
Hereâs what one of my dashboards with a single filter gives me:
{
"description":null,
"database_type":"char",
"table_id":135,
"table":{
"description":null,
"entity_type":"entity/GenericTable",
"schema":"dbo",
"db":{
"description":null,
"features":[
"native-query-params",
"basic-aggregations",
"no-case-sensitivity-string-filter-options",
"standard-deviation-aggregations",
"expression-aggregations",
"foreign-keys",
"native-parameters",
"nested-queries",
"expressions",
"binning"
],
"cache_field_values_schedule":"0 0 0 * * ? *",
"timezone":"UTC",
"metadata_sync_schedule":"0 0 * * * ? *",
"name":"Database",
"caveats":null,
"is_full_sync":true,
"updated_at":"2018-07-19T03:32:23.000Z",
"details":{
"host":"DbServer",
"port":123,
"db":"Database",
"user":"User",
"password":"Password",
"ssl":false,
"tunnel-port":22,
"let-user-control-scheduling":false
},
"is_sample":false,
"id":2,
"is_on_demand":false,
"options":null,
"engine":"sqlserver",
"created_at":"2018-07-15T05:18:19.000Z",
"points_of_interest":null
},
"show_in_getting_started":false,
"name":"Filter",
"caveats":null,
"fields_hash":"ISGfrgdAXpRUDgiGpVMy6w==",
"rows":null,
"updated_at":"2018-11-01T01:00:07.000Z",
"entity_name":null,
"active":true,
"id":135,
"db_id":2,
"visibility_type":null,
"display_name":"Filter",
"created_at":"2018-07-15T05:18:21.000Z",
"points_of_interest":null
},
"special_type":"type/PK",
"name":"codigo",
"fingerprint_version":2,
"has_field_values":"list",
"settings":null,
"caveats":null,
"fk_target_field_id":null,
"dimensions":[
],
"updated_at":"2018-07-19T04:15:48.000Z",
"active":true,
"parent_id":null,
"id":2183,
"last_analyzed":"2018-07-19T04:04:33.000Z",
"position":0,
"visibility_type":"normal",
"preview_display":true,
"display_name":"codigo",
"name_field":{
"id":2144,
"table_id":135,
"display_name":"nombre",
"base_type":"type/Text",
"special_type":"type/Name",
"has_field_values":"list"
},
"fingerprint":{
"global":{
"distinct-count":15
},
"type":{
"type/Text":{
"percent-json":0.0,
"percent-url":0.0,
"percent-email":0.0,
"average-length":2.0
}
}
},
"created_at":"2018-07-15T05:18:33.000Z",
"base_type":"type/Text",
"points_of_interest":null
}
@BrettJohnson
You might want to dig around in the internal Metabase database - hopefully youâre not using H2.
Youâll most likely find something in the table metabase_fieldvalues
- but there are a lot of tables, which could have interesting data concerning this issue.
Here is the JSON object for the values request
@BrettJohnson
Thatâs the field meta request - the values are coming in a second request. But the field meta looks fine, so Iâm guessing the dropdown works in that case.
You have to monitor/test and see what happens, when the dropdown doesnât work.
Hey!
The last reply to this topic was almost 2 years ago but let me try my luck and see whether someone answers.
I read through the whole thread and following questions remain:
1. How can we obtain updated field filter values in the Metabase database?
If I look into the JSON object (see therefore example below), I see that the key value pair âupdated_atâ is not updated to the most recent date.
[
{
âidâ: 1234,
âcreated_atâ: â2020-10-14 15:05:10.353556â,
âupdated_atâ: â2020-11-03 14:51:25.665458â,
âvaluesâ: â[âaâ,âbâ,âtâ,âiâ,âmâ]â,
âhuman_readable_valuesâ: null,
âfield_idâ: 29012
}
]
2. What exactly happens in the backend when Metabase collects the list of values for a dashboard drop down filter?
E.g. does it perform an UNION in a query in the background? How does Metabase know what it should display to the user?
Your support is highly appreciated! Thanks in advance!
@matrioschka That is handled by the daily scan:
https://www.metabase.com/docs/latest/administration-guide/01-managing-databases.html#database-sync-and-analysis
Thereâs an issue in the 0.37, which causes a query when showing the dropdown:
https://github.com/metabase/metabase/issues/13832
Thanks so much!!
Helped me really a lot. Highly appreciated.