Articles in this section
Category / Section

How to pass custom Elastic Search query in JSON format in Bold BI dashboard

Published:

Bold BI allows users to specify Elasticsearch queries in JSON format while loading the dashboard. This feature enables the visualization of filtered data based on the query passed. However, it’s important to note that custom queries cannot be passed in Elasticsearch live connection. Instead, this can be achieved through the Web API data source.

Steps to Pass Custom Query in JSON Format

  1. For custom query support, a sample data source with a dashboard parameter is needed. Create the sample data source using the Elasticsearch connector. If there are any data sources in the dashboard, they can also be used for dashboard parameter creation.

    image.png

  2. After connecting/editing the data source, drag and drop any table and then click the dashboard parameter icon.

    image.png

  3. The dashboard parameter window will open. In this window, enter a name for the parameter, select Mode as “Literal”, Type as “String” and enter the Custom query in the Current value test box. Save the parameter.

    image.png

    Note: Here we have set the mark value as 80 in custom query

  4. Save the data source.

  5. Now, connect to the Elasticsearch server using the Web API connector.

    image.png

  6. Enter the server URL with index in the URL textbox and change the method type to “Post”.

    image.png

  7. Set the dashboard parameter in the raw body section. In the raw body section, enter the “@” character, dashboard parameters name suggestions will be shown.

    image.png

  8. Select the dashboard parameter created for the custom query.

    image.png

  9. Enter the authentication details and select mode as live connection.

    image.png

  10. Click Preview & Connect. The Elasticsearch server will now be connected.

    image.png

  11. The data is shown based on the given custom query.

  12. Save the data source and drag and drop some widgets and assign values using the Web API data source.

    image.png

  13. Select preview.

    image.png

  14. Click the dashboard parameter icon in the preview window.

    image.png

  15. The dashboard parameter window will open, now change the custom query value and then click apply.

    image.png

  16. The data in widgets get filtered based on the given custom query in the dashboard parameter.

    image.png

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
RM
Written by Reethika Moovendhan
Updated
Comments (0)
Please  to leave a comment
Access denied
Access denied