cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
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. 

 

 

 

 

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.