diff --git a/superset-frontend/src/dashboard/actions/nativeFilters.ts b/superset-frontend/src/dashboard/actions/nativeFilters.ts index 359adb87ea59c..337d3044a5411 100644 --- a/superset-frontend/src/dashboard/actions/nativeFilters.ts +++ b/superset-frontend/src/dashboard/actions/nativeFilters.ts @@ -188,6 +188,25 @@ export const setInScopeStatusOfFilters = type: SET_IN_SCOPE_STATUS_OF_FILTERS, filterConfig: filtersWithScopes, }); + // need to update native_filter_configuration in the dashboard metadata + const { metadata } = getState().dashboardInfo; + const filterConfig: FilterConfiguration = + metadata.native_filter_configuration; + const mergedFilterConfig = filterConfig.map(filter => { + const filterWithScope = filtersWithScopes.find( + scope => scope.id === filter.id, + ); + if (!filterWithScope) { + return filter; + } + return { ...filterWithScope, ...filter }; + }); + metadata.native_filter_configuration = mergedFilterConfig; + dispatch( + dashboardInfoChanged({ + metadata, + }), + ); }; type BootstrapData = {