Forum Discussion

paddyg95's avatar
paddyg95
Regular Visitor
2 years ago
Solved

Retrieving data from file uploaded to SharePoint list

Hi, I have created a SharePoint list where users will upload an Excel file every time they make an entry to the list. I am using a list rather than just a file folder just for greater control of t...
  • BA_Pete's avatar
    BA_Pete
    2 years ago

    Hi Paddy,

     

    Try this:

    1) Connect to your SP list using the SharePoint Online List connector in Power Query and choose the 1.0 Implementation. This is important as the 2.0 version won't give you the [AttachmentFiles] column that you need.

    2) Expand the [AttachmentFiles] column files selecting the [ServerRelativeUrl] column to expand.

    2.5) Important - at this point, filter the list to ensure only attachments that have the same data structure remain.

    3) Create a new custom column like this:

    "https://yourcompany.sharepoint.com" & [ServerRelativeUrl]
    //Obvs change "yourcompany" to whatever your actual URL is

     

    4) Copy one of the complete URLs from your new column, open the Web connector, and connect to this URL. Complete any transformations you want to do on all of the attachments in this query.

    5) Open Advanced Editor for this Web query and copy ALL of the M code from there. Go back to your SharePoint query and add another custom column.

    6) Paste the M code into the formula window for this custom column, but change the URL to reference your full URL column instead, like this:

     

    Now, when you click OK, you should get a column with nested tables that contain each of your transformed attachments that you can expand to append them all together:

     

    Pete