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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
po
Post Prodigy
Post Prodigy

Connecting to sharepoint data source

Hi,

 

Have a working report which uses sharepoint as a source but to get this to work I had to connect to the all documents on the site and filter them and select file etc.

resulting power query below.

 

let
Source = SharePoint.Files("https://<company_name>.sharepoint.com/sites/BI/", [ApiVersion = 15]),
#"Filtered Rows" = Table.SelectRows(Source, each ([Extension] = ".csv")),
#"workspaces csv_https://menziesdistribution sharepoint com/sites/BI/Shared Documents/Power BI/Workspace Inventory/" = #"Filtered Rows"{[Name="workspaces.csv",#"Folder Path"="https://menziesdistribution.sharepoint.com/sites/BI/Shared Documents/Power BI/Workspace Inventory/"]}[Content],
#"Imported CSV" = Csv.Document(#"workspaces csv_https://menziesdistribution sharepoint com/sites/BI/Shared Documents/Power BI/Workspace Inventory/",[Delimiter=",", Columns=7, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(#"Imported CSV", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Id", type text}, {"Name", type text}, {"Type", type text}, {"State", type text}, {"IsReadOnly", type logical}, {"IsOrphaned", type logical}, {"CapacityId", type text}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Name", "WorkspaceName"}})
in
#"Renamed Columns"

 

Just wondering if easier better way of doing this e.g. tried source below but doesn't work.

 

Is there a quciker way to do this in tersm of code.  I'm just thinking whilst not that many documents on site if this grows speed will slow down a little.

 

https://<company_name>.sharepoint.com/sites/BI/Shared Documents/Power BI/Workspace Inventory/workspaces.csv

 

 

Thanks

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @po ,

If you want to get one specific file in SharePoint folder, I would suggest you to use Web connector instead of SharePoint connector to save some time.

URL will be like:

https://xxxx.sharepoint.com/sites/xxxx/Shared Documents/<file name>

web connector.png

 

Best Regards,
Yingjie Li

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

View solution in original post

3 REPLIES 3
v-yingjl
Community Support
Community Support

Hi @po ,

If you want to get one specific file in SharePoint folder, I would suggest you to use Web connector instead of SharePoint connector to save some time.

URL will be like:

https://xxxx.sharepoint.com/sites/xxxx/Shared Documents/<file name>

web connector.png

 

Best Regards,
Yingjie Li

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

Hi,

 

Thanks for suggestion.

 

This looks to work but I had to go to teams and right clcik the link suchh that it accepts the url with %20 otherwise it was syaing invlaid URL.

 

https://<company>.sharepoint.com/sites/BI/Shared%20Documents/Power%20BI/Workspace%20Inventory/worksp...

 

Also,  chose organization and auth2 on the service.

 

Only thing is though if my password changes then will need to update the credentials.

 

Not sure what shoudl put for this - any thoughts and recommendations for this part?

 

screenshot_authorisation.png

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.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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