Forum Discussion
Integrating Dataflows Gen2 into Pipelines
- 2 years ago
Here is a solution which includes a simple notebook
I know you didn't want notebook, however this is what I came up with...
I'm asking ChatGPT to help me with the code so it gets a lot easier.
My variable is similar like yours:
My Notebook activity:
My Notebook looks like this:
I have connected my Notebook to a default Lakehouse. This is indicated by the pin symbol.
This is called "attach a default Lakehouse" and you do it easily in the user interface. You see the pin symbol then it's good. You can also do it without a "default Lakehouse" but then you need to add some more code.
ChatGPT helped me with the code.
This creates a file. I just called it output.json. Every time I run the pipeline, the file content gets overwritten.
My DataflowGen2 connects to this output.json file:
let Source = Lakehouse.Contents([]), #"Navigation 1" = Source{[workspaceId = "<EnterWorkspaceIdHere>"]}[Data], #"Navigation 2" = #"Navigation 1"{[lakehouseId = "<EnterLakehouseIdHere>"]}[Data], #"Navigation 3" = #"Navigation 2"{[Id = "Files", ItemKind = "Folder"]}[Data], #"Navigation 4" = #"Navigation 3"{[Name = "output.json"]}[Content], ToJson = Json.Document(#"Navigation 4"), #"Converted to table" = Record.ToTable(ToJson), #"Filtered rows" = Table.SelectRows(#"Converted to table", each ([Name] = "value")), #"Removed other columns" = Table.SelectColumns(#"Filtered rows", {"Value"}), #"Split column by delimiter" = Table.ExpandListColumn(Table.TransformColumns(Table.TransformColumnTypes(#"Removed other columns", {{"Value", type text}}), {{"Value", Splitter.SplitTextByDelimiter("|"), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Value") in #"Split column by delimiter"I think here are some workarounds if you still don't want to use notebook. The post titles say Web activity, but the same principles should apply even if you're not using Web activity as your source.
Solved: How to save output from a web activity? - Microsoft Fabric Community
How to save complete web activity output to ADLS Gen2? - Microsoft Q&A
- 2 years ago
Thank you so much for your reply. As you guessed, I really am trying to avoid Notebooks. Therefore, I have come up with a simpler solution, but I am still running into trouble. I will make a new post to better describe it. Your expertise is very much appreciated, so please keep a look out for it! 🙂
Did you take a look at the workarounds I mention (links) at the bottom of my long comment? These workarounds don't use Notebook, only Data Pipeline.
Also consider voting for the Ideas mentioned, in order to highlight the need for native support of cases like this in Data pipeline.
Hi, yes, I did look at those links and even tried to set up a Web activity, but I couldn't figure it out. So, I decided to go with your Notebook solution.
If you are able to implement one of those Web solutions and post a reply, that would be awesome. I know that is a lot to ask though.
I have managed to implement the Notebook solution, but it takes more than 10 minutes to run which is why I haven't marked your reply as a solution just yet. I have another post for that problem too. There are so many issues it seems to just simply setting up a Pipeline. I was even watching a Youtube video where the guys demonstrating Notebooks were encountering errors they were unable to resolve. LOL
- frithjof_v2 years agoCommunity Champion
Is it the notebook activity which is using 10 minutes?
I would expect the notebook activity to be a lot faster than that
Or is it the dfg2 activity that consumes most of the time?
Unfortunately I don't have the time at the moment for testing different setups. There was also a workaround which included a dummy file and a copy activity. But for my part I think I will just stick with using a Notebook. It seems at the moment that Notebook is a central piece in Data pipelines, at least as long as it's not possible to pass data between pipeline and dfg2.
- frithjof_v2 years agoCommunity Champion
From where are you getting the metadata, by the way?
Perhaps you could do the get metadata part also in a Dataflow Gen2?
In that case you could do everything inside your dfg2, and thus avoid having to pass the information from pipeline into dfg2.