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:ย 

call job parameter in notebook

Hritik_Moon
New Contributor

Notebook1 as a list output (d_list) and stored in a taskValue

N1.png

I have provided this as input to a loop for notebook 2

loopInput.png

These are the parameters for notebook2

N2.png

 

job.png

 

How do I get the value of the parameters file_name and file_format inside notebook2?

when I try print(file_name) it gives error file_name is not defined.

1 ACCEPTED SOLUTION

Accepted Solutions

szymon_dybczak
Esteemed Contributor III

Hi,

In notebook2 define 2 widget parameters that will receive those parameters

 

dbutils.widgets.text("file_name", "")
file_name= dbutils.widgets.get("file_name")
 
dbutils.widgets.text("file_format", "")
file_format= dbutils.widgets.get("file_format")

View solution in original post

4 REPLIES 4

szymon_dybczak
Esteemed Contributor III

Hi,

In notebook2 define 2 widget parameters that will receive those parameters

 

dbutils.widgets.text("file_name", "")
file_name= dbutils.widgets.get("file_name")
 
dbutils.widgets.text("file_format", "")
file_format= dbutils.widgets.get("file_format")

szymon_dybczak
Esteemed Contributor III

Let me know if you managed to do it @Hritik_Moon in a way I described above. In case of any issues I can prepare for you an end to end example ๐Ÿ™‚

Thanks @szymon_dybczak you are a great help. ๐Ÿ˜Š

 

szymon_dybczak
Esteemed Contributor III

No problem @Hritik_Moon , glad that could help ๐Ÿ™‚

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