Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

How to retrieve binary files specified in a Sharepoint list?

I want to put images in my reports, including paginated reports, published via the Power BI Service. I accomplished this by saving some images to a Sharepoint folder, accessing them via the Sharepoin...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

     

    You can use the Sharepoint.Files connector to retrieve the binary data of files in a SharePoint list, in addition to their metadata. This connector allows you to search for files in a SharePoint site or library by specifying a folder path, a file name, or both.

    To retrieve the binary data of a file in a SharePoint list, you can use the Binary function and pass it the URL of the file as an argument. For example:

    Copy code

    Binary(

    "<mytenant>.sharepoint.com

    )

    This function will return the binary data of the file as a table with a single column Binary. You can then use this table in a Table.AddColumn or Table.TransformColumns function to add the binary data as a new column to your list of files.

    You can also use the Sharepoint.Files connector to search for files in a SharePoint list by specifying a folder path and a file name. For example:

    Copy code

    Sharepoint.Files(

    "<mytenant>.sharepoint.com

    [ApiVersion = 15]

    )

    This will return a table with a list of all the files in the specified folder. You can then use a Table.Filter function to filter this table to only include files with a specific file name.

    Finally, you can use the Table.AddColumn or Table.TransformColumns function to add the binary data of the filtered files to the table, using the Binary function as described above.

    I hope this helps! Let me know if you have any questions or need further assistance.

     

     

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.