How to give access for custom JSON using PostgreSql data source?
The Bold BI application allows you to access custom JSON data using a PostgreSQL data source by following these steps.
Steps to access custom JSON data in Bold BI
-
Refer to the Connecting Bold BI to PostgreSQL data source documentation for successful connection.
-
Drag and drop the table that has the JSONB data type in Bold BI, as displayed in the image below.
NOTE: The JSONB data type will be hidden in the
data preview
, but it can be accessed by creating expressions in Bold BI. -
Click
Save
to save the data source with a relevant name in order to proceed with designing the dashboard.
Note: You can also create expressions on the data source page itself:
-
Drag and drop the
Grid
widget and click on theAssign data
section to start creating expressions.
-
Click on the
Add Expression
button as shown in the following image.
-
Then add the JSON path value in the Expression editor as shown in the following image and click
Save
.
Operator Usage -> The operator -> returns the JSON object field by key. ->> The operator ->> returns the JSON object field by key as text. Index Index(0) is used to filter data from array without using a key. -
Assign values to the widget as shown in the following image.
-
Now, you can view the JSONB data retrieved from the PostgreSQL server and visualize it in Bold BI as shown in the following image.
-
You can also access the JSONB data using queries in a code view mode. Switch to the code view by enabling the toggle option in the tools pane in the data design view, as shown in the following image.
-
In the Query Editor Window, you can enter the query that helps access JSONB data. After entering your query, click the
Run
icon in the tools pane.
-
You can view the data for your query at the bottom of the Query Editor by clicking Update.