Changing Stored Procedure Parameter Value Dynamically in Bold BI
In Bold BI, you can pass parameter values to stored procedures dynamically. This can be achieved by creating a parameter in the data source and using it while creating a second data source. Here is a step-by-step guide on how to do this:
Step 1: Create a Parameter in Data Source 1
- In the data source used for Grid1, create a parameter using the integer column that you need to pass as a parameter. Make sure you have selected the “Set First value” option to pass one numeric value. This option is important as it ensures that a value is passed to the stored procedure when the dashboard is loaded for the first time. Without this, the stored procedure might not return any data, leading to an empty dashboard.
Step 2: Configure Stored Procedure Parameter in Data Source 2
-
While creating the second data source (used in Grid2), when it asks for a parameter while dragging and dropping the stored procedure, use the “Parameter” option (Value Type) instead of giving a value for the parameter.
-
Choose the parameter that you created in Data Source 1 and save the data source to use it in the widget.
-
Make sure that you have chosen the “OpenQuery” option to fetch live data. This option allows the dashboard to fetch the latest data from the database whenever the parameter value changes.
Step 3: Bind the Parameter to a Combo-box
-
Bind the parameter from Data Source 1 to a combo box. Whenever you change the value in the Parameter combo box, the stored procedure in Grid2 will take the parameter dynamically based on the combo box selection.
Note: You can also change the parameter value in the parameter window
In Bold BI, the data sources that support stored procedures include:
- Microsoft SQL Server
- Oracle
- MySQL
- Azure Synapse Analytics
- MariaDB
- SingleStore