GitHub user dosubot[bot] added a comment to the discussion: Reports Loads Data 
without Filters Applied

<!-- Greeting -->
Hi @risvanjunaid-jpg! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping 
the superset team.

<!-- Answer -->
You can prevent dashboards and charts in Superset from loading data until a 
filter is applied by configuring your native filters with the "Filter value is 
required" option (this is the `enableEmptyFilter` setting for Select filters) 
or by marking filters as "required first" in the filter configuration. When you 
do this, the dashboard will not initialize and load data until the user selects 
a value for the required filter(s) — no data will be shown by default, and only 
filtered data will load after user interaction 
[example](https://github.com/apache/superset/blob/master/superset-frontend/src/filters/components/Select/controlPanel.ts),
 [dashboard 
logic](https://github.com/apache/superset/blob/master/superset-frontend/src/dashboard/components/DashboardBuilder/state.ts).

Default filter values only pre-select a value and do not prevent initial data 
loading; the "required" options are what enforce that no data is loaded until a 
filter is chosen.

To set this up: edit your dashboard, add a native filter, and in the filter 
configuration, enable "Filter value is required" (or set `requiredFirst` for 
other filter types). Save the dashboard. Now, users will see an empty state 
until they select a filter value.

If you want to show a custom message when no data is loaded (for example, 
before filters are applied), you can set a custom empty state message in the 
dashboard properties [details](https://github.com/apache/superset/pull/37638).

This approach helps avoid loading large, unnecessary data and improves 
dashboard performance.


<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*

---
<sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/b44d780c-8d28-4d09-ac77-a5f297049471?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/b44d780c-8d28-4d09-ac77-a5f297049471?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/b44d780c-8d28-4d09-ac77-a5f297049471?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/b44d780c-8d28-4d09-ac77-a5f297049471?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/b44d780c-8d28-4d09-ac77-a5f297049471?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/b44d780c-8d28-4d09-ac77-a5f297049471?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/b44d780c-8d28-4d09-ac77-a5f297049471?feedback_type=other)</sup>

[![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=You%20can%20prevent%20dashboards%20and%20charts%20in%20Superset%20from%20loading%20data%20until%20a%20filter%20is%20applied%20by%20configuring%20your%20native%20filters%20with%20the%20%22Filter%20value%20is%20required%22%20option%20%28this%20is%20the%20%60enableEmptyFilter%60%20setting%20for%20Select%20filters%29%20or%20by%20marking%20filters%20as%20%22required%20first%22%20in%20the%20filter%20configuration.%20When%20you%20do%20this%2C%20the%20dashboard%20will%20not%20initialize%20and%20load%20data%20until%20the%20user%20selects%20a%20value%20for%20the%20required%20filter%28s%29%C2%A0%E2%80%94%C2%A0no%20data%20will%20be%20shown%20by%20default%2C%20and%20only%20filtered%20data%20will%20load%20after%20user%20interaction%C2%A0%5Bexample%5D%28https%3A//gi
 
thub.com/apache/superset/blob/master/superset-frontend/src/filters/components/Select/controlPanel.ts%29%2C%20%5Bdashboard%20logic%5D%28https%3A//github.com/apache/superset/blob/master/superset-frontend/src/dashboard/components/DashboardBuilder/state.ts%29.%0A%0ADefault%20filter%20values%20only%20pre-select%20a%20value%20and%20do%20not%20prevent%20initial%20data%20loading%3B%20the%20%22required%22%20options%20are%20what%20enforce%20that%20no%20data%20is%20loaded%20until%20a%20filter%20is%20chosen.%0A%0ATo%20set%20this%20up%3A%20edit%20your%20dashboard%2C%20add%20a%20native%20filter%2C%20and%20in%20the%20filter%20configuration%2C%20enable%20%22Filter%20value%20is%20required%22%20%28or%20set%20%60requiredFirst%60%20for%20other%20filter%20types%29.%20Save%20the%20dashboard.%20Now%2C%20users%20will%20see%20an%20empty%20state%20until%20they%20select%20a%20filter%20value.%0A%0AIf%20you%20want%20to%20show%20a%20custom%20message%20when%20no%20data%20is%20loaded%20%28for%20example%2C%20before
 
%20filters%20are%20applied%29%2C%20you%20can%20set%20a%20custom%20empty%20state%20message%20in%20the%20dashboard%20properties%C2%A0%5Bdetails%5D%28https%3A//github.com/apache/superset/pull/37638%29.%0A%0AThis%20approach%20helps%20avoid%20loading%20large%2C%20unnecessary%20data%20and%20improves%20dashboard%20performance.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/37834)

GitHub link: 
https://github.com/apache/superset/discussions/37834#discussioncomment-15753879

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to