cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Dashboard - get value from table on user click

mbhakta
New Contributor II

I'm building a dashboard via Python notebook and trying to allow the end user to click a value on a table, and use the selected value in another query / panel. This somewhat works using widget dropdowns for a user to select which value, but I'd really like to make the user experience nicer!

Is it possible to get a row or value from a table on user click?

1 REPLY 1

Henrymartin
New Contributor II

@mbhakta wrote:

I'm building a dashboard via Python notebook and trying to allow the end user to click a value on a table, and use the selected value in another query / panel. This somewhat works using widget dropdowns for a user to select which value, but I'd really like to make the user experience nicer!

Is it possible to get a row or value from a table on user click?


Hello,

Yes, it is possible to enhance the user experience by allowing users to interact with the table and retrieve selected values for further analysis in your Python notebook dashboard.

To achieve this, you can use interactive widgets and event handlers from libraries like ipywidgets and pandas. Create a table using the DataFrame from pandas, and then convert it to an interactive widget using widget.HTML. You can use the on_click event handler to capture the user's click on the table. When the user clicks on a specific row or value, the event handler function can extract the selected value and use it for subsequent queries or data analysis.

Here's a general outline of the process:

Create a DataFrame using pandas to represent your table data.


Convert the DataFrame to an interactive widget using widget.HTML.


Define an event handler function that captures the click event and retrieves the selected value from the table.
Use the selected value in another query or panel within your Python notebook dashboard.


By implementing this approach, users can simply click on the desired value in the table, and your dashboard will automatically utilize the selected value to update other components in real-time. This creates a more user-friendly and seamless experience, as users can easily explore and analyze data without manually inputting values.

I hope the information may helps you. 

 

 

 

 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group