SherifAbouKlila
New Contributor II

you can use widget

1- Create widget

Python

dbutils.widgets.text("y",'3')

or

SQL

CREATE WIDGET TEXT y DEFAULT '3'

2- Access the current value of the widget

Python

dbutils.widgets.get("y")

or

SQL

SELECT * FROM test_table WHERE key=getArgument("y") --key=$y -- The old way of creating widgets in SQL queries with the $<parameter> syntax still works as before

For more information about widgets. please check this link

https://docs.databricks.com/user-guide/notebooks/widgets.html