Unmesha Sreeveni shows how you can create a widget in a Databricks notebook:
In order to get some inputs from user we will require widgets in our Azure Databricks notebook.
This blog helps you to create a text based widget in your python notebook.
The syntax is rather similar for Scala as well.