Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
DennesTorres
Impactful Individual
Impactful Individual

Reference one notebook from another

Hi,

 

Is it possible to reference one notebook from another?

If I have some generic code used in multiple notebooks, is it possible to make an import?

 

Kind Regards,

 

Dennes

1 ACCEPTED SOLUTION
12angrymentiger
Advocate III
Advocate III

Yes you can with 2 different methods. The first method below %run with no parameters allows you to reference any child variables in the parent notebook. The second method (mssparkutils) runs in another session so you are not allowed to see the variables in the parent notebook.

 

2 methods:

  • %run notebook_name
  • mssparkutils.notebook.run("path", 90, {"input": 20 })

 

Introduction to Microsoft Spark utilities - Azure Synapse Analytics | Microsoft Learn

View solution in original post

3 REPLIES 3
12angrymentiger
Advocate III
Advocate III

Yes you can with 2 different methods. The first method below %run with no parameters allows you to reference any child variables in the parent notebook. The second method (mssparkutils) runs in another session so you are not allowed to see the variables in the parent notebook.

 

2 methods:

  • %run notebook_name
  • mssparkutils.notebook.run("path", 90, {"input": 20 })

 

Introduction to Microsoft Spark utilities - Azure Synapse Analytics | Microsoft Learn

Anonymous
Not applicable

Anonymous
Not applicable

Hi @DennesTorres 
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. Otherwise, will respond back with the more details and we will try to help.
Thanks

Helpful resources

Announcements
FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Fabric Update Carousel

Fabric Monthly Update - March 2026

Check out the March 2026 Fabric update to learn about new features.