I need to provide a filter for an Apache Superset dashboard via URL parameter and apply the filter to the data shown. I can set the filter via URL parameter, but it is not applied to the data in the charts.
I followed the steps in the article Apache Superset — Use URL to filter dashboards. The filter is set correctly in the UI at the top left. But the filter is not automatically applied to the data. I need to manually click "APPLY FILTERS" at the bottom left to actually activate the filter settings I passed on in the URL.
Others seem to have the same problem, see this Github issue. How can I configure Apache Superset so that a filter provided via URL parameter is automatically applied to the data?
I found the problem. It was sitting before the keyboard. In the URL I was using the wrong value for the <column> parameter. When applying the second "name" tag from the "targets" section as <column> the filtering works as expected, see the JSON METADATA of the dashboard below.
The instructions from the article Apache Superset — Use URL to filter dashboards work exactly as I need it. You construct the URL parameters like this:
native_filters=(NATIVE_FILTER-<id>:(__cache:(label:'<value>',validateStatus:!f,value:!('<value>')),extraFormData:(filters:!((col:<column>,op:IN,val:!('<value>')))),filterState:(label:'<value>',validateStatus:!f,value:!('<value>')),id:NATIVE_FILTER-<id>,ownState:()))
You get <id> = m3qtzHVtH and <column> = planning_group from the JSON METADATA:
{
"id": "NATIVE_FILTER-m3qtzHVtH",
"controlValues": {
"enableEmptyFilter": false,
"defaultToFirstItem": false,
"multiSelect": false,
"searchAllOptions": true,
"inverseSelection": false
},
"name": "Customer (Planning Group)",
"filterType": "filter_select",
"targets": [{"datasetId": 104, "column": {"name": "planning_group"}}],
"defaultDataMask": {``