How to modify Specific column or table name via API?
There are chances for schema updates such as, renaming existing fields or tables in source data (underlying dataset) in timely manner. These changes need to be kept synchronized with the published data source and any associated dashboards in Bold BI. This article provides step-by-step instructions on how to address this need and overcome challenges that you may encounter.
Scenario
Consider that you have a Microsoft SQL Server database table named Order Details connected to Bold BI.
Afterwards, you have effortlessly transferred the table onto the query designer page through the simple act of dragging and dropping, subsequently preserving the data source.
Ultimately, you have successfully integrated this data into the widget and published the dashboard.
Handling Column Deletion or Renaming Changes
I aim to rename the column currently titled “New_Column4” to a new name, New_Column5.
Kindly initiate a refreshing action upon the dashboard page in order to promptly rectify the data retrieval issue.
We must address and overcome this issue by adhering to the following steps.
How to facilitate API authentication can be accomplished through the utilization of this provided link.
Input | |
---|---|
URL | http://{domain}/bi/api/site/{sitename}/v4.0/datasources/columns |
Method | Put |
Content Type | application/json |
Authorizations | bearer token |
Request Body Schema |
[
{
"DataSourceId": "string",
"ColumnInfo":
[
{
"Type": "Column",
"SourceColumnName":"string",
"TargetColumnName":"string"
}
]
}
]
Sample Response
For Reference
Parameter | Description . |
---|---|
DataSourceId | Enter DatasourceID. |
Type | Either “Table” or “Column” |
SourceTableName | Previous name of Table |
TargetTableName | Current name of Table |
SourceColumnName | Previous name of Column |
TargetColumnName | Current name of Column |
After Passing the Data Source ID through API, kindly refresh the published dashboard.
We have now ensured that the Updated column is available within the assign Data panel.
Related Links
How to refresh data source fields in Bold BI when the underlying dataset schema changes via API?
How to refresh data source fields in Bold BI when the underlying dataset schema changes via run button?