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: 

Interactive Notebook with widgets

elgeo
Valued Contributor II

Dear experts,

We need to create a notebook in order the users to insert/update values in a specific table. We have created one using widgets. However the code performed per action selected is visible to the users. Is there a way to have in a the dropdown etc widgets in a notebook available to the users and the code relative to the actions to be in another one where they won't have access?

Thank you in advance!

 

1 REPLY 1

Mounika_Tarigop
Databricks Employee
Databricks Employee

You can separate the user interface (UI) from the code logic by using two notebooks.

1) The first notebook will contain the code that performs the actions based on the widget inputs.

2) The second notebook will contain the widgets that users interact with. Use dbutils.widgets to create the necessary widgets. Use the %run magic command to call the logic notebook, passing the widget values as parameters.

https://docs.databricks.com/en/notebooks/widgets.html#use-databricks-widgets-with-run

 

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now