Forum Discussion

aiwithchirag's avatar
aiwithchirag
Frequent Visitor
2 years ago
Solved

How to access SharePoint Lists Attachment in Fabric

Hi,   I was thinking if I have a list in which I have multiple attachments within different or same row items, how I can access this using Fabric, I mean creating any DataFlow or something such tha...
  • frithjof_v's avatar
    frithjof_v
    2 years ago

    I see. If I understand correctly, you basically just want to store a copy of the files somewhere.

     

    I guess you can use Notebook or Data Pipeline to copy the files into a files folder in a Lakehouse.

     

    Or you could create a folder for each list item, and insert the files which are attached to each list item. (automatically).

     

    I don't know the code for doing that, and unfortunately I don't have the time to test that now, but it sounds like something which is doable.

     

    ---

     

    It seems maybe you will need to create an app registration (service principal) in Azure and give this service principal access to the Sharepoint list, and then use the service principal to authenticate to the Sharepoint list attachments from either a Notebook or Data pipeline.

     

    Perhaps this documentation will help:

    Working with folders and files with REST | Microsoft Learn

     

    I am guessing use GET method to get each attachment file from Sharepoint via API, and then have the Notebook or Data pipeline save the file in a folder in Fabric Lakehouse.

     

    ---

     

    If a low code approach is preferred, I am thinking maybe Power Automate could be an alternative way of extracting the attachments from the list:

    How to store all attachments from a SharePoint list to one folder? - Microsoft Q&A

    Save Attachments from Existing SharePoint List to Document Library and Create Individual folders - Microsoft Q&A

     

    But per my knowledge there are no Fabric connectors in Power Automate. So if the aim is to store the files in Fabric, I think it would need to use some API: Solved: Automate file movement lakehouse > onderive - Microsoft Fabric Community

    If going ahead with Power Automate, maybe the easiest is to just store the attachment files in another folder in Sharepoint which is "visible" in the Sharepoint document hierarchy (as opposed to the list attachments folders, which seem to be "hidden" in Sharepoint).