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

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
tonyclifton
Helper III
Helper III

Process and store files of Sharepoint Online folder in Database

Hello community,

I am new to Fabric and what I thought was a simple task turns out to be quite complicated.

I need to process files in a Sharepoint Online folder, transform the data of each file using PowerQuery in a Dataflow (I believe), store the transformed data in a DB and after the successful import to the DB the file should be moved to an Archive folder of the same Sharepoint library.

I followed this guide to set up the connection to Sharepoint and retrieve the files via a pipeline:
https://www.syntera.ch/blog/2022/10/10/copy-files-from-sharepoint-to-blob-storage-using-azure-data-f...

The part I cannot follow anymore is everything after "6. Iterate through list of files and copy each file to ADLS".
Is there no easier way to simply access the file and then transform it?

As a test I already created a dataflow Gen2 which works but I need to handle each file separately as well as move the processed files to an Archive folder.

What options do I have?

Thank you very much.


4 REPLIES 4
nilendraFabric
Community Champion
Community Champion

Hello @tonyclifton 

Data pipeline would be a simple solution as @lbendlin  suggested.

 

  1. Create a new data pipeline in Microsoft Fabric

  2. Add a Lookup activity to get a list of files from your SharePoint folder

  3. Follow this with a ForEach activity to iterate through each file

  4. Inside the ForEach loop, add:

    • A Dataflow activity to transform the data

    • A Copy Data activity to load data into your database

    • A procedure or activity to move the file to an archive folder

Hello @nilendraFabric 
thanks for your process structure. The part I struggle with starts in your listing at number 4.

So I have the foreach loop and get the binary file content in a Web activity like so:
/_api/web/getfilebyserverrelativeurl('/sites/DataTest/@{item().Name}')/$value

What I don't undertand is how to then pass this binary data to the Dataflow:

tonyclifton_0-1741933103204.png
What do I put as "Dataflow ID"? My guess was it needs to be the output of the previous step:

tonyclifton_1-1741933182180.png

But by filling that Dataflow ID I can't even open the dataflow. Or do I need to create this dataflow differently and later on pass the output to the dataflow?


Thank you.






@nilendraFabric I am not sure whether the lookup activity supports Sharepoint folders. You might need to use a web activity to get the list of all files within that folder.
Also as of today, based on my understanding, Dataflow inputs cannot be parameterized and they need to be hardcoded. So in case if one uses DF, they would have to set up multiple DFs for diff files and transformations.

So the flow can be as below :

Within Data pipeline :

a) web activity to get list of files
b) copy files into a lakehouse/database as is
c) do transformations via SQL
d) move the file to another location within lakehouse




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com
lbendlin
Super User
Super User

and after the successful import to the DB the file should be moved to an Archive folder of the same Sharepoint library

That is not something you can do in a dataflow.  Look at pipelines.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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