cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results for 
Search instead for 
Did you mean: 

Automate running the first two command cells of all my notebooks

Anonymous
Not applicable

I extensively use widgets in my Databricks notebooks, to provide interactivity to the community that runs my notebooks interactively. In the current setup we have, whenever I push my notebooks from dev to prod, the widgets are erased and have I have to create them manually. We know that this can be avoided by changing the way we move them from dev to prod, but for another issue, this is not possible yet. So in the meantime, my question is: Is it possible to write a notebook that would loop through all the notebooks in the same folder, and simply run the first two command cells in every notebook? Thanks!

1 REPLY 1

Anonymous
Not applicable

have you tried dbutils.notebook.exit('whatever you want to type here') after the two cells?

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now