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: 

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?

3 REPLIES 3

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.

Uma Mahesh D

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

dev56
New Contributor II

Hi @cmilligan , I have a similar requirement and would really be grateful if you could provide me with any information on how to fix this issue. Thanks a lot!

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