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

 

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