The Dynamic Connection String feature allows you to modify the connection string of data sources in dashboard view mode. This feature enables you to view the modified connection string on the Bold BI application itself and on embedded dashboards using the Dashboard Embedding feature.
NOTE: To embed the Bold BI application, please refer Embed Bold BI documentation.
When creating live mode connections, it is necessary to configure a Web API that will provide the modified connection string.
The configured API will be triggered for each data source created with Dynamic Connection String Configuration during dashboard rendering. The connection string in the data source will be updated and the dashboard will be rendered based on the response from the API.
If the API cannot be accessed or if the API returns any errors, the dashboard will display an error message indicating that the connection is invalid.
Create a live mode connection with any database management systems such as MSSQL, MySQL, PostgreSQL, etc.
In the connection input form, click the Dynamic Connection String switch to enable the Dynamic Connection String feature for the data source.
Click the Configure button to open the dialog for Dynamic Connection Configuration.
In the Dynamic Connection Configuration dialog, the External API option will be selected by default. Please fill out the form for the Web API and click Save. The API will be validated by triggering a Head request. Please ensure that the provided API supports the HTTP HEAD method.
At the bottom of the dialogue, there is a pinned option to choose the Configuration Mode and User Identity for the Dynamic Connection Configuration.
Configuration Mode
The Dynamic Connection String can function in different modes, which can be used to limit its functionality to the embedded application, the server, or both.
Embedding | The dashboards can only be rendered with a modified connection string when they are embedded using the Dashboard Embedding feature. |
Server | The Bold BI application only allows for rendering the dashboards with a modified connection string. |
Both | It is possible to render the dashboards with a modified connection string on both the Bold BI application and dashboards embedded using the Dashboard Embedding feature. |
User Identity
The identity that should be passed to the custom Web API is meant to enhance the usage of a modified connection string at runtime. This can hold the logged-in user’s information, such as their Email
and Full Name
.
After saving the configuration, please proceed with the creation of the data source.
At the beginning of the dialogue, there is a radio button that allows you to select either the External API or Custom Attribute for the Dynamic Connection Configuration.
Select the Custom Attribute option for the Custom Attribute in Dynamic Connection Configuration.
Please enter the attribute name in the Custom Attribute section, which was created on the site. Ensure that the custom attribute was created at the Site Level.
At the bottom of the dialog, there is a pinned option to choose the Configuration Mode. In Configuration Mode, select the Both option and click Save.
After saving the configuration, follow the Uses of custom attribute in configuring custom attribute to complete the configuration.
NOTE: The configuration can be modified or removed at any time by accessing the Edit Connection dialog for the data source.
We can utilize any technology to develop the Web API. The return type and content type of the API should be JSON.
The Dashboard Service will pass the following arguments when triggering the API.
Arguments
requiredParams |
Comma separated values. The API should return the value with the keys mentioned in the argument.
Eg: MSSQL required Parameters for the connection string are |
datasourceName | Name of the data source |
datasourceId | GUID of the data source as string. |
customIdentity | The string value that holds the user identity information based on the identity type chose on Dynamic Connection String Configuration. Also it can be override while the dashboard embedded using the Dashboard Embedding feature |
identityType | The string value that holds the type of the user identity chose on Dynamic Connection String Configuration either `Email` or `Full Name`. Also it should be `Custom` while custom identity is passed on dashboard embedded using the Dashboard Embedding feature |
NOTE: During the validation of the HEAD request, the above arguments will not be passed to the API.
Parameters for the connection string
Data Source | Parameters |
Amazon Athena | Database,RegionEndpoint,OutputLocation,AwsAccessKeyId,AwsSecretAccessKey |
Amazon Aurora MySQL | ServerName,Database,UserName,Password,Port,AdvancedSettings,CommandTimeout |
Amazon Aurora PostgreSQL | ServerName,Database,UserName,Password,Port,SslMode,TrustServerCertificate,AdvancedSettings,CommandTimeout |
Amazon RDS MariaDB | ServerName,Database,UserName,Password,Port,AdvancedSettings,CommandTimeout |
Amazon RDS MySQL | ServerName,Database,UserName,Password,Port,AdvancedSettings,CommandTimeout |
Amazon RDS PostgreSQL | ServerName,Database,UserName,Password,Port,SslMode,TrustServerCertificate,AdvancedSettings,CommandTimeout |
Amazon RDS SQL | DataSource,InitialCatalog,UserName,Password,IntegratedSecurity,AdvancedSettings,CommandTimeout |
Amazon Redshift | ServerName,Database,UserName,Password,Port,SslMode,TrustServerCertificate,AdvancedSettings,CommandTimeout |
Azure Synapse Analytics | DataSource,InitialCatalog,UserName,Password,IntegratedSecurity,AdvancedSettings,CommandTimeout |
CDATA with MySQL endpoints | ServerName,Database,UserName,Password,Port,AdvancedSettings,CommandTimeout |
ClickHouse | ServerName,Database,Port,UserName,Password,AdvancedSettings,CommandTimeout |
Elasticsearch | ServerName,Database,Port,UserName,Password,AuthenticationType,AdvancedSettings,ConnectionType |
Google BigQuery (This is supported only for Service Account Authentication) | ServiceId, Service, Provider, Database, IsServiceAccount, ClientID, Type, ClientEmail, PrivateKey |
Google Cloud MySQL | ServerName,Database,UserName,Password,Port,AdvancedSettings,CommandTimeout |
Google Cloud PostgreSQL | ServerName,Database,UserName,Password,Port,SslMode,TrustServerCertificate,AdvancedSettings,CommandTimeout |
InfluxDB | ServerName,Database,UserName,Password,Port,AuthenticationType,AdvancedSettings,CommandTimeout |
MariaDB | ServerName,Database,UserName,Password,Port,AdvancedSettings,CommandTimeout |
ODBC | ServerName,Port,UserName,PassWord,Database,DsnName,odbctype,Driver,AdvancedSettings,CommandTimeout |
Oracle | ServerName,Port,Service,Database,UserName,Password,AdvancedSettings,CommandTimeout |
PostgreSQL | ServerName,Database,UserName,Password,Port,SslMode,TrustServerCertificate,AdvancedSettings,CommandTimeout |
Presto | ServerName,Port,UserName,Password,Database,CatalogName,AuthenticationType,AdvancedSettings |
SingleStore | ServerName,Database,UserName,Password,Port,AdvancedSettings,CommandTimeout |
SnowFlake | ServerName,Database,UserName,Password,AdvancedSettings,CommandTimeout |
SparkSQL | ServerName,Port,Database,UserName,Password,AuthenticationType,AdvancedSettings |
SQL server | DataSource,InitialCatalog,UserName,Password,IntegratedSecurity,AdvancedSettings,CommandTimeout |
Return Type
Type: ApiResponse class
public class ApiResponse
{
public bool Status { get; set; }
public string Message { get; set; }
public object Data { get; set; }
}
The API should return the response as the above Class object.
APIResponse Class Properties
Status | Represents whether the action is successful or not. Set as true if the response is valid connection string. |
Message | Holds the status message it can be a simple “Success” or an error message when the status is false. |
Data | Holds the Connection string builder data. |
Example Response
{
Status: true,
Message: "Success",
Data: {
DataSource: "<server>",
InitialCatalog: "<database>",
Username: "<username>",
Password: "<password>",
IntegratedSecurity: "false",
AdvancedSettings: "",
CommandTimeout: "300"
}
}
NOTE: If the response or the connection string is invalid, then the dashboard will not be rendered, and an error message will be displayed on the widgets.
The custom identity can only be passed to the viewer when the dashboard is embedded using the Dashboard Embedding feature.
The custom identity should be passed through the dynamicConnection API.
Example
var dashboard = BoldBI.create({
dynamicConnection: {
isEnabled: true,
identity: "",
}
});
dashboard.loadDashboard();
NOTE: The value of the identity property should be a string, which will not be processed at the Bold BI end. This information will be passed to the API without any modifications.
To configure the dynamic connection string for a dashboard’s data source using the same database with a different schema, we can utilize the necessary “Schema” parameter in the modified connection string.
The API response from the Custom Web API should include the connection parameter schema in the modified connection string.
Example Response
{
Status: true,
Message: "Success",
Data: {
DataSource: "<server>",
InitialCatalog: "<database>",
Username: "<username>",
Password: "<password>",
IntegratedSecurity: "false",
AdvancedSettings: "",
CommandTimeout: "300",
Schema: "<schema>"
}
}
Dynamic Connection String support provides another way to connect the data source using Custom Attributes.
You can edit a data source by following these steps:
Please enter the data source connection string in JSON format in the Custom Attribute window.
Dynamic connection string supported Datasources
Data Source | Connection String |
|
|
|
|
|
|
Oracle |
|
InfluxDB |
|
Amazon Athena |
|
Elasticsearch |
|
ODBC |
|
Presto |
|
SparkSQL |
|
SnowFlake |
|
Google BigQuery |
|
NOTE :This is supported only for Service Account Authentication
Open the Dynamic connection string configuration window and navigate to the Custom Attribute option.
Please enter the valid custom attribute in the window provided and click Save.
Please refer to the help document below for instructions on configuring Custom Attribute. Click on the custom attribute for more information.