GitHub user dosubot[bot] added a comment to the discussion: Passing parameters
<!-- Greeting --> Hi @tien260604! I'm [Dosu](https://go.dosu.dev/dosubot) and Iām helping the superset team. <!-- Answer --> You can pass parameters like year and company name to your stored procedure in Superset by using Jinja templating in your dataset's SQL. For example, you can write your SQL as: ```sql CALL your_stored_procedure({{ filter_values('year') }}, {{ filter_values('company_name') }}) ``` Each chart can have its own parameters by setting up chart-level filters in the Explore view or using dashboard native filters. These filters will map to the Jinja variables in your SQL, so each chart can send different values to the stored procedure depending on its filter settings. Make sure `ENABLE_TEMPLATE_PROCESSING` is enabled in your Superset config for this to work. Note: Some databases (like SQL Server) support calling stored procedures with parameters directly, but others (like MySQL) may have limitations in SQL Lab or dataset queries [[discussion](https://github.com/apache/superset/discussions/34555)]. If you run into issues with syncing columns when using Jinja variables, you can temporarily remove the template variables, sync columns, and then re-add them [[issue](https://github.com/apache/superset/issues/25839#issuecomment-2591521614)]. Let me know if you need a more detailed example or have a specific database engine in mind! <!-- 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/593c315c-cd3f-4a48-9489-c38d1bad8a79?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/593c315c-cd3f-4a48-9489-c38d1bad8a79?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/593c315c-cd3f-4a48-9489-c38d1bad8a79?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/593c315c-cd3f-4a48-9489-c38d1bad8a79?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/593c315c-cd3f-4a48-9489-c38d1bad8a79?feedback_type=hallucination) | [Report š](https://app.dosu.dev/response-feedback/593c315c-cd3f-4a48-9489-c38d1bad8a79?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/593c315c-cd3f-4a48-9489-c38d1bad8a79?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)& nbsp;[](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/35462) GitHub link: https://github.com/apache/superset/discussions/35462#discussioncomment-14579435 ---- 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]
