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

Join us at the 2025 Microsoft Fabric Community Conference. March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for $400 discount. Register now

Reply
Master
Helper I
Helper I

end user UI in notebook

Is there a way to present a form to users in a fabric notebook and retrieve the data entered either with a Python UI library such as tkinter or with an HTML form?

 

In the first case (Tkinter), it is impossible to display anything, there is no "display".

 

In the second case (HTML), it is impossible to return the data to my python code of the notebook that displayed the form (but the form works).

 

Thank you for your help

10 REPLIES 10
Master
Helper I
Helper I

Hi,

Does anyone have any news regarding this issue/need?

Microsoft recently introduced Python Notebook in Fabric. I haven't tested it yet. You can check if this will lead to a better experience. Announcing Python Notebook in Preview | Microsoft Fabric Blog | Microsoft Fabric

At the moment, there doesn't seem to be any change on this point with the new native Fabric notebook.

Master
Helper I
Helper I

The need to create user-friendly forms for end users is to integrate data update functions. For example, allowing them to update thresholds, etc. Offering this directly in Microsoft Fabric would allow us to avoid other application infrastructure. In addition, there are a lot of users who ask us: "can we update data with Power BI". Many people are looking for an easy way to update data in Power BI. ipwydgets is definitely not a library allowing us to data a user-friendly interface, it feels like the 80s.

Data modification in Power BI (aka "Data Write Back")  has been a sore spot for years. Technically you should not write into a downstream system (you should write into the system that feeds Power BI) but there are ways to make that process work seamlessly -  for example by first modifying the sematic model (for good UX) and then in the background sync the change with the data source.

 

As for the notebooks - are you sure you want to expose that part of the process to end users?

No, this is not data that is necessarily subject to return to the source systems. In most cases, this is data that is strictly useful for data analysis. In addition, third-party applications are often used in SaaS mode and it is not possible to add data to the source system.

The idea is to add additional analysis data at the warehouse level to enable rich and dynamic BI solutions.

Similarly, the idea is that the data specialist team can do the work with data world technologies (Python) without needing to have knowledge of C# development for example.

v-jingzhan-msft
Community Support
Community Support

I did some more research, below are some additional information regarding tkinter

 

Why tkinter is not suitable for Fabric notebooks:

tkinter is a Python library used for creating graphical user interfaces (GUIs). It relies on a display server to render the GUI elements. In environments like Fabric notebooks, which are often run on remote servers or in headless setups (without a graphical display), there is no display server available. This leads to errors like TclError: no display name and no $DISPLAY environment variableInstead, you can use ipywidgets or other notebook-friendly libraries.

 

Best Regards,
Jing

Maybe before notebooks were reserved for data scientists and for their own use but this is no longer the case in 2024. Soon (Q3 2024), we will even be able to publish a notebook in a Power BI application. Notebooks become an alternative method to present user data. We then have the immensity of python libraries, the possibilities multiply enormously by delivering notebook solutions to end users. This will be increasingly used in this sense.

v-jingzhan-msft
Community Support
Community Support

Hi @Master 

 

I have no experience with tkinter or HTML form. I tried ipywidgets to collect some data and it retrieved the data to the notebook. Below is my test result. You may give it a try!

vjingzhanmsft_0-1725417737679.png

import ipywidgets as widgets

# Create form widgets
name = widgets.Text(description="Name:")
age = widgets.IntText(description="Age:")
submit_button = widgets.Button(description="Submit")

# Function to handle form submission
def on_submit(button):
    print(f"Name: {name.value}, Age: {age.value}")

# Attach the function to the button
submit_button.on_click(on_submit)

# Display the form
display(name, age, submit_button)

displayString = "Welcome to Fabric, " + name.value + "!"
display(displayString)

 

The Python environment in the notebook is PySpark, not a native Python. Therefore, some Python libraries might not work well in the Fabric notebook, as its primary purpose is for data engineering and data science, not for App development. If you need to design complex forms or collect a lot of data, it's better to use other tools to collect the information in advance and export it to a file format that the Fabric notebook can handle.

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

yes, I know, there is only ipywidgets that works but it is not with that that I will give an interesting experience worthy of 2024 to the end users. see my other comments. thank you

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebFBC_Carousel

Fabric Monthly Update - February 2025

Check out the February 2025 Fabric update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.