Forum Discussion
Writeback using UDF to Lakehouse table
- 10 months ago
Hello Shubham_rai955 ,
Thank you for reaching out to the Microsoft fabric community forum.Directly updating a Lakehouse table using a Fabric UDF is not supported right now. Lakehouse is mainly for analytics, not for transactional updates.
If you need writeback from Power BI, here are the best options:
Use a Fabric SQL Database this is Microsoft’s recommended way because it supports UDFs and transactions properly or use a staging approach ,Send changes to a staging table and then run a notebook or pipeline to update your main Lakehouse table.Direct writeback into Lakehouse through UDF is not reliable today. Using SQL DB or staging will give you a stable solution.
Kindly refer to the below documentation links for better understanding:
Choose between Lakehouse and Warehouse in Fabric
Hope the above provided information help you resolve the issue, if you have any further concerns or queries, please feel free to reach out to us.Regards,
Community Support Team.
Hi Shubham_rai955 ,
Have you tried looking into translytical task flows? I have tested them with a Fabric SQL Database and it really works like a charm. Essentially, you register a User Data Function (Fabric UDF; Note, there are also DAX UDFs (User Defined Functions, but in the context of translytical taskflows we refer to UDFs as User Data Functions) and then you can update records from the Power BI front end.
I have not tested it myself with a Lakehouse table, but I could imagine it to work, too as you write Python Code in your User Data Function. However, my gut feeling says that a database would be handling such transactions in a better fashion (maybe that is why Microsoft recommends using a SQL DB).
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/