Interactive Notebook with widgets
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 03:41 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 09:45 PM
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

