cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown for parameters in a job

cmilligan
Contributor II

I want to be able to denote the type of run from a predetermined list of values that a user can choose from when kicking off a run using different parameters. Our team does standardized job runs on a weekly cadence but can have timeframes that changed depending on the month or if it is a one off run to test. I am wanting to change the behavior of the run depending on the type of run it is and want to have users choose from a list to reduce errors like misspellings. Is there a good option to do this inside of the job itself, rather than a notebook?

2 REPLIES 2

UmaMahesh1
Honored Contributor III

Hi @Coleman Milligan​ 

Checking the old unanswered questions and stumbled across this.

You can do that using the databricks widgets.

dbutils.widgets.dropdown("state", "CA", ["CA", "IL", "MI", "NY", "OR", "VA"])

If this widget is not helping you in passing parameters, you can do a try catch in all the notebooks to check if the parameter value you are passing is actually in the list of strings you have.

Hope this helps.

Cheers.

Hi @Uma Maheswara Rao Desula​ , thank you for the reply.

I'm actually wondering if there is a way to do this within the job ui using the 'run with different parameters' functionality.

It would be the environment key that I'm wanting to restrict user inputs into a predetermined list.

Screenshot_20221207_113039

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.