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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Keyvan
Regular Visitor

Get Data from SharePoint not default Document library

Hello Experts,

Is there any simple way to get data from non default SharePoint Document Library?

I have bunch of Document library within my site and can not read an Excel file from them.

Thanks in advance.

1 ACCEPTED SOLUTION
edhans
Super User
Super User

Yes. When you initially connect to a SharePoint library, you are initially given a Source connection string that looks like this:

= SharePoint.Files("https://TenantName.sharepoint.com/sites/Reports", [ApiVersion = 15])

Change it to this:

= SharePoint.Contents("https://TenantName.sharepoint.com/sites/Reports", [ApiVersion = 15])

 Then you will see a listing simliar to this:

edhans_0-1602519464924.png

Shared Documents is the default library, but now you can click on the Table value for any folder and continue to drill down that way until you get to your files.

 

The only issue with this is you can only ultimately see one folder at a time. SharePoint.Files will allow you to work with many folders at a time. SharePoint.Contents only shows one.

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

4 REPLIES 4
edhans
Super User
Super User

Yes. When you initially connect to a SharePoint library, you are initially given a Source connection string that looks like this:

= SharePoint.Files("https://TenantName.sharepoint.com/sites/Reports", [ApiVersion = 15])

Change it to this:

= SharePoint.Contents("https://TenantName.sharepoint.com/sites/Reports", [ApiVersion = 15])

 Then you will see a listing simliar to this:

edhans_0-1602519464924.png

Shared Documents is the default library, but now you can click on the Table value for any folder and continue to drill down that way until you get to your files.

 

The only issue with this is you can only ultimately see one folder at a time. SharePoint.Files will allow you to work with many folders at a time. SharePoint.Contents only shows one.

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Hello Edhans,

First, Thanks for your replay.

Which data source you select?

When I selech Sharepoint folder it doesn't give me that screenshot that you had shared!

I found it, thank you.

Great @Keyvan - glad you got it working. 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

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