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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
TheFifthJoin
New Contributor III

Read Notebook cell string from another notebook

Is this even possible? 

 

I want to programatically loop through my transformation notebooks and parse the materialised lake view SQL to get a source field, destination field, and a bunch of other useful information for a data dictionary. Plus side to building a loop is I can run it on a schedule and report if any field name or data types change for any reason and ping that down the line to my reporting guys or data quality.

 

I can get all the notebooks within folders easilly enough, and parsing the string would be straight forward - but actually grabbing the content is proving difficult.

 

I've played around with Get Notebook Definition but the Body JSON is always null? Is there another way / API endpoint i've not found?

 

Thanks

1 ACCEPTED SOLUTION
Vinodh247
Contributor III

Fabric does not expose notebook cell contents through the public APIs today. Get Notebook Definition only returns metadata, not the code or markdown cells which is why the body field is always null. I believe the product team has not exposed any API to fetch notebook source programmatically.

 

Possible options as of today:

  1. Store your SQL logic in external files (Lakehouse, Git, or a mirrored repo) and have notebooks read from there. Then you can parse those files easily.

  2. Use Fabric Git integration (if enabled) and parse the notebook source from the .ipynb representation in Git. That is currently the only reliable method to get notebook content automatically.

  3. Move your transformation logic into pipelines, dataflow gen2 or SQL scripts if you want first class lineage parsing.

But directly reading notebook cell strings from another notebook or API is not supported today.

 

Please 'Kudos' and 'Accept as Solution' if this answered your query.

Regards,
Vinodh
Microsoft MVP [Fabric]
LI: https://www.linkedin.com/in/vinodh-kumar-173582132
Blog: vinsdata.in

View solution in original post

2 REPLIES 2
Vinodh247
Contributor III

Fabric does not expose notebook cell contents through the public APIs today. Get Notebook Definition only returns metadata, not the code or markdown cells which is why the body field is always null. I believe the product team has not exposed any API to fetch notebook source programmatically.

 

Possible options as of today:

  1. Store your SQL logic in external files (Lakehouse, Git, or a mirrored repo) and have notebooks read from there. Then you can parse those files easily.

  2. Use Fabric Git integration (if enabled) and parse the notebook source from the .ipynb representation in Git. That is currently the only reliable method to get notebook content automatically.

  3. Move your transformation logic into pipelines, dataflow gen2 or SQL scripts if you want first class lineage parsing.

But directly reading notebook cell strings from another notebook or API is not supported today.

 

Please 'Kudos' and 'Accept as Solution' if this answered your query.

Regards,
Vinodh
Microsoft MVP [Fabric]
LI: https://www.linkedin.com/in/vinodh-kumar-173582132
Blog: vinsdata.in

I can confirm linking the workspace to devops, then using the devops API to find notebook-content.py files under whatever location you have files saved in, you can grab the file.text directly. ๐Ÿ‘

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Free Fabric Certifications

Free Fabric Certifications

Get Fabric certified for free! Don't miss your chance.

January Fabric Update Carousel

Fabric Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (6,725)