Write Back Gantt Chart Project Data in Power BI to the Database
This blog is a part of the Gantt Chart Blog Series.
The xViz Gantt Chart for Microsoft Power BI allows users to perform runtime edits. This is one of the most liked features of this visual, and such changes can also be stored as a bookmark. However, some may prefer to persist the changes to an on-premise or cloud data store such as a SQL Server on Microsoft Azure. We’ll look at how such a ‘writeback’ scenario can be implemented in the xViz Gantt Chart.
- Let’s start with a sample Gantt visual in Power BI
- From the design-time ‘Format’ pane, enable Live Editing.
- You will now find 2 fields – “Fetch End Point” and “Update End Point”.
- Update Endpoint: This endpoint URL/API to which the edited data needs to be posted
- Fetch Endpoint (optional for two-way integration): This fetches the updated data and loads it into the visual
How do the fetch & update endpoints work?
Technically the Gantt chart makes an HTTP POST request whenever there is a change made by the user. So, you would need an intermediate server that can receive and process these requests. In the case of an update request, this server would parse the fields in the data sent by the Gantt chart and transform them into an appropriate format required by the target backend system (e.g. a SQL database. In this example, the backend system is Airtable). In the case of a fetch, the intermediate server would cascade back the updated changes to the fetch endpoint through which the Gantt chart gets updated.
How do I create the intermediate server?
You can write a simple server using any of the web framework technologies such as node.js, python flask, and more. For reference, here are a sample code of a server with two (2) endpoints (GET /getwritebackdata as a fetch endpoint and POST /process_data as an updated endpoint)
Once you have the code, deploy it in your local webserver or on a cloud platform like Heroku.
Finally, you can then use the fetch and update endpoints and use them to configure the Gantt Chart as shown below.
Now you have set up a Gantt visual that can write back to your database. The following video explains how you can achieve this.
Check out the other Key Features of xViz Gantt Enterprise for Power BI here.
You can find other blogs related to Gantt Enterprise here.
Get Started with xViz today!
Try xViz to instantly visualize the power of business optimization.