# Specify Dashboard Parameter Values | Business Intelligence Dashboard | DevExpress Documentation

This topic describes how to specify [dashboard parameter](/Dashboard/117062/web-dashboard/create-dashboards-on-the-web/data-analysis/dashboard-parameters) values in the UI and in code.

## Change Parameter Values in the UI

### Standard Parameter Editor

The Web Dashboard control includes a built-in **Dashboard Parameters** dialog, which allows users to change dashboard parameter values. This dialog is created automatically depending on the parameter settings. Select the **Visible** check box in the [parameter settings](/Dashboard/117547/web-dashboard/create-dashboards-on-the-web/data-analysis/dashboard-parameters/create-a-dashboard-parameter) to display the parameter in the **Dashboard Parameters** dialog.

To invoke the **Dashboard Parameters** dialog in the Web Dashboard, click the **Parameters** button in the [dashboard title](/Dashboard/117383/web-dashboard/ui-elements-and-customization/dashboard-title). Change the parameter values in the **Dashboard Parameters** dialog and click the **Submit** button to apply the changes.

You can invoke the **Dashboard Parameters** dialog and change a parameter value as follows:

![Parameters Dialog](/Dashboard/images/dashboard-parameters-web.gif)

To reset changes to the default values, click the **Reset** button.

To invoke and close this dialog in code, call the [DashboardParameterDialogExtension.show](/Dashboard/js-DevExpress.Dashboard.DashboardParameterDialogExtension#js_devexpress_dashboard_dashboardparameterdialogextension_show) and [DashboardParameterDialogExtension.hide](/Dashboard/js-DevExpress.Dashboard.DashboardParameterDialogExtension#js_devexpress_dashboard_dashboardparameterdialogextension_hide) methods.

### Custom Parameter Item

You can use a custom item to change values of the dashboard parameters. A custom **Parameter** item renders the **Dashboard Parameters** dialog content inside the dashboard layout and allows you to change and submit parameter values. 

![Custom Parameters Dialog in the Web Dashboard](/Dashboard/images/custom-dashboard-parameter-item.png)

This item supports the following settings that you can configure in the items **Options** menu:

- Show Headers

    - Specifies whether to show headers in the parameters table.

- Show Parameter Name

    - Specifies whether to show the first column with parameter names.

- Automatic Updates

    - Specifies whether the parameter item is updated automatically. When enabled, this option hides the **Submit** and **Reset** buttons.

To use this custom item in your application, follow the steps below:

1. Add an extension script to your application:

     You can find scripts for a custom **Parameter** item in the following repositories based on the platform:

     [View Example: ASP.NET Core](https://github.com/DevExpress-Examples/asp-net-core-dashboard-custom-item-gallery) 
 [View Example: Angular](https://github.com/DevExpress-Examples/dashboard-angular-app-custom-item-gallery) 
 [View Example: React](https://github.com/DevExpress-Examples/dashboard-react-app-custom-item-gallery)
2. Call the [DashboardControl.registerExtension](/Dashboard/js-DevExpress.Dashboard.DashboardControl#js_devexpress_dashboard_dashboardcontrol_registerextension_extensions_) method to register the [extension](/Dashboard/117543/web-dashboard/concepts-and-terminology/extensions) in the Web Dashboard:

    ```
    // The dashboardControl variable is the obtained DashboardControl instance.
    dashboardControl.registerExtension(new ParameterCustomItem(dashboardControl));            
    ```

     See the following topic for information on how to get access to `DashboardControl`: [Web Dashboard - Client-Side Specifics](/Dashboard/119283/web-dashboard/concepts-and-terminology/web-dashboard-technical-overview#client-side-specifics).

For more information on custom items, refer to the following article: [Custom Dashboard Item for Web](/Dashboard/400302/web-dashboard/create-dashboards-on-the-web/dashboard-item-settings/custom-item).

## Request Parameter Values before Data Loading

You can display a parameters window at startup and prompt a user to input parameter values before a dashboard loads and aggregates data. Dashboard items display the following message to guide users: “Waiting for Parameter Values…”.

![Web Dashboard - Waiting for parameter values](/Dashboard/images/web-dashboard-request-param-check-box-waiting-values.png)

The Web Dashboard control loads data only after the user submits all visible parameters. This operation mode prevents unnecessary data requests and ensures the dashboard fetches only data the user actually needs.

To activate this mode, open the [dashboard menu](/Dashboard/117444/web-dashboard/ui-elements-and-customization/dashboard-menu), switch to the **Parameters** page, and select the following checkbox: **Request Parameter Values before Data Loading**. The setting value is saved in the dashboard XML definition.

**The corresponding property:** [Dashboard.requestParameters](/Dashboard/js-DevExpress.Dashboard.Model.Dashboard#js_devexpress_dashboard_model_dashboard_requestparameters)

If a user changes this option at runtime, they need to initiate a data reload. The dashboard displays a *Dashboard Parameters* pop-up before it fetches data.

## Change Parameter Values in Code

### Server-Side

Use the following events to change the dashboard parameter value, validate it, or add new dashboard parameters before they are passed to the query:

- [ASPxDashboard.CustomParameters](/Dashboard/DevExpress.DashboardWeb.ASPxDashboard.CustomParameters)

    - Occurs before data is loaded from the data store and allows you to change parameter values before they are passed to a data query.

- [DashboardConfigurator.CustomParameters](/Dashboard/DevExpress.DashboardWeb.DashboardConfigurator.CustomParameters)

    - Occurs before data is loaded from the data store and allows you to customize [dashboard parameters](/Dashboard/117062/web-dashboard/create-dashboards-on-the-web/data-analysis/dashboard-parameters) that are used for data processing.

The selected event depends on the [server-side API](/Dashboard/12139/web-dashboard/integrate-dashboard-component/aspnet-web-forms-dashboard-control/server-side-api-overview) used in your application.

The following code snippet changes the **countryParameter** parameter value before it is passed to the query:

```
configurator.CustomParameters += (s, e) => {
    // The countryParameter parameter value is changed to `Brazil`.
    var countryParam = e.Parameters.FirstOrDefault(p => p.Name == "countryParameter");
    if (countryParam != null) {
        countryParam.Value = "Brazil";
    }
```

Note that the value specified in the event handler is not displayed in the **Dashboard Parameters** dialog.

The following code sample adds a new dashboard parameter (**countryParameter**) and specifies its value:

```
configurator.CustomParameters += (s, e) => {
    // A new dashboard parameter is created with the `Brazil` string as a value.
    e.Parameters.Add(new DashboardParameter("countryParameter", typeof(string), "Brazil"));
    }
```

Caution

Parameter values specified in the `CustomParameters` event handler are set before executing a data query. They are not displayed in the **Dashboard Parameters** dialog. However, if the client `IncludeHiddenParameters` property is enabled (for example, [DashboardExcelExportOptions.IncludeHiddenParameters](/Dashboard/js-DevExpress.Dashboard.DashboardExcelExportOptions#js_devexpress_dashboard_dashboardexcelexportoptions_includehiddenparameters)), a user can still get access to all hidden parameters along with their values.

You can also specify the parameter value at runtime in the [dashboard state](/Dashboard/118733/web-dashboard/integrate-dashboard-component/aspnet-web-forms-dashboard-control/manage-dashboard-state). The value specified in the dashboard state is displayed in the **Dashboard Parameters** dialog and can be changed by a user. For more information on how to manage dashboard parameters in the dashboard state, refer to the following section: Manage Parameters in the Dashboard State.

In the following examples, the [ASPxDashboard.CustomParameters](/Dashboard/DevExpress.DashboardWeb.ASPxDashboard.CustomParameters) / [DashboardConfigurator.CustomParameters](/Dashboard/DevExpress.DashboardWeb.DashboardConfigurator.CustomParameters) events are handled to change the dashboard parameter value before it is passed to the query.

As a result, users see a dashboard based on the data from the SQL query with the parameter value from the `CustomParameters` event.

[View Example: ASP.NET Core](https://github.com/DevExpress-Examples/asp-net-core-dashboard-pass-hidden-parameters-to-custom-sql-query) 
[View Example: ASP.NET Web Forms](https://github.com/DevExpress-Examples/web-forms-dashboard-pass-hidden-parameters-to-custom-sql-query)

### Client-Side

On the client side, the Web Dashboard utilizes the [DashboardControl](/Dashboard/js-DevExpress.Dashboard.DashboardControl) class to supply users with a UI to design and interact with a dashboard. You can use its API to specify parameter settings.

The [DashboardParameterDialogExtension.getParameters](/Dashboard/js-DevExpress.Dashboard.DashboardParameterDialogExtension#js_devexpress_dashboard_dashboardparameterdialogextension_getparameters) method returns the instance of the [DashboardParameterCollection](/Dashboard/js-DevExpress.Dashboard.DashboardParameterCollection) class that is a collection of dashboard parameters ([DashboardParameter](/Dashboard/js-DevExpress.Dashboard.DashboardParameter)). You can get the parameter type, the default parameter values, and the parameter name. You can also obtain possible parameter values or specify the current parameter value.

Use the following methods to work with dashboard parameters on the client side:

- [DashboardParameterDialogExtension.getParameters](/Dashboard/js-DevExpress.Dashboard.DashboardParameterDialogExtension#js_devexpress_dashboard_dashboardparameterdialogextension_getparameters)

    - Returns dashboard parameter settings and metadata.

- [DashboardParameterCollection.getParameterList](/Dashboard/js-DevExpress.Dashboard.DashboardParameterCollection#js_devexpress_dashboard_dashboardparametercollection_getparameterlist)

    - Returns an array of dashboard parameters from the [DashboardParameterCollection](/Dashboard/js-DevExpress.Dashboard.DashboardParameterCollection).

- [DashboardParameterCollection.getParameterByIndex](/Dashboard/js-DevExpress.Dashboard.DashboardParameterCollection#js_devexpress_dashboard_dashboardparametercollection_getparameterbyindex_index_)

    - Returns a dashboard parameter by its index in the [DashboardParameterCollection](/Dashboard/js-DevExpress.Dashboard.DashboardParameterCollection).

- [DashboardParameterCollection.getParameterByName](/Dashboard/js-DevExpress.Dashboard.DashboardParameterCollection#js_devexpress_dashboard_dashboardparametercollection_getparameterbyname_name_)

    - Returns a dashboard parameter by its name.

- [DashboardParameter.getDefaultValue](/Dashboard/js-DevExpress.Dashboard.DashboardParameter#js_devexpress_dashboard_dashboardparameter_getdefaultvalue)

    - Returns a default parameter value.

- [DashboardParameter.getName](/Dashboard/js-DevExpress.Dashboard.DashboardParameter#js_devexpress_dashboard_dashboardparameter_getname)

    - Returns a parameter name.

- [DashboardParameterDialogExtension.getParameters](/Dashboard/js-DevExpress.Dashboard.DashboardParameterDialogExtension#js_devexpress_dashboard_dashboardparameterdialogextension_getparameters)

    - Returns dashboard parameter settings and metadata.

- [DashboardParameter.getType](/Dashboard/js-DevExpress.Dashboard.DashboardParameter#js_devexpress_dashboard_dashboardparameter_gettype)

    - Returns a parameter type.

- [DashboardParameter.getValue](/Dashboard/js-DevExpress.Dashboard.DashboardParameter#js_devexpress_dashboard_dashboardparameter_getvalue)

    - Returns the current parameter value(s).

- [DashboardParameter.setValue(value)](/Dashboard/js-DevExpress.Dashboard.DashboardParameter#js_devexpress_dashboard_dashboardparameter_setvalue_value_)

    - Specifies the current parameter value(s).

The following examples show how to change the parameter values on the client:

[View Example: ASP.NET Core](https://github.com/DevExpress-Examples/asp-net-core-dashboard-specify-dashboard-parameter-values-on-the-client) 
[View Example: ASP.NET Web Forms](https://github.com/DevExpress-Examples/web-forms-dashboard-specify-dashboard-parameter-values-on-the-client) 

## Manage Parameters in the Dashboard State

[DashboardState](/Dashboard/js-DevExpress.Dashboard.Model.DashboardState) stores changes resulting from end-user interaction - selected master filter values, drill-down levels, selected dashboard item layers, and current parameter values. Use the [DashboardState.Parameters](/Dashboard/js-DevExpress.Dashboard.Model.DashboardState#js_devexpress_dashboard_model_dashboardstate_parameters) property to access states of dashboard parameters. 

See the following topics for more information:

- [Manage Dashboard State in JavaScript Applications](/Dashboard/401093/web-dashboard/integrate-dashboard-component/dashboard-control-for-javascript-applications-jquery-knockout-etc/manage-dashboard-state)
- [Manage Dashboard State in ASP.NET MVC Applications](/Dashboard/119765/web-dashboard/integrate-dashboard-component/aspnet-mvc-dashboard-extension/manage-dashboard-state)
- [Manage Dashboard State in ASP.NET Core Applications](/Dashboard/119997/web-dashboard/integrate-dashboard-component/aspnet-core-dashboard-control/manage-dashboard-state)
- [Manage Dashboard State in ASP.NET Web Forms Applications](/Dashboard/118733/web-dashboard/integrate-dashboard-component/aspnet-web-forms-dashboard-control/manage-dashboard-state)

The following examples illustrate how to specify a [dashboard state](/Dashboard/119765/web-dashboard/integrate-dashboard-component/aspnet-mvc-dashboard-extension/manage-dashboard-state) in code and apply this state when loading a dashboard for the first time:

[View Example: ASP.NET Core](https://github.com/DevExpress-Examples/aspnet-core-dashboard-specify-default-state-in-code) 
[View Example: ASP.NET Web Forms](https://github.com/DevExpress-Examples/web-forms-dashboard-specify-default-dashboard-state-in-code)