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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Mederic
Helper V
Helper V

SharePoint path not working

Hello,


I'm trying to connect to a SharePoint folder in Power query (Excel 365).
I get an error message like this: Incorrect request (400)....etc
For information, the path is very long with many folders and subfolders

When I use a folder near to the Https root, it works

Is there a maximum length for the path?

If not, how can I get round this problem?

Thanks in advance

 

Best regards

10 REPLIES 10
Mederic
Helper V
Helper V

Hello @christinepayton ,

Sorry for the late return,
I tested today at my office with the "ODATA" connector but unfortunately I can't connect. It keeps asking me to sign in to an account.

Thanks anyway for your help

Best regards

That's right, I don't get an error message but I do get an authentication request every time.
I couldn't find the option for Browser authorisation in Ofiice 365,
I'll do some research to see if it's possible.

Thank you

Best regards

It's this one:

christinepayton_0-1697903273031.png

 

If it asks you to sign in repeatedly with no error, the fix for that is to go into the Power BI Desktop settings under Security and set it to use your default browser for authentication. I have had this happen to me too at various points... I don't know why it should matter, but it seems to resolve it.

Mederic
Helper V
Helper V

Hello @christinepayton ,

 

Thank you for another interesting suggestion.
I've just tested it with the Odata connector but unfortunately I didn't get any results.
I'm going to try it tomorrow from our company connection because at home I have to get special approval to access SharePoint (connection security via smartphone).

I will test this tomorrow from my office

For information, yesterday I said that the full URL with the Excel file works. I'll just point out that it's with a Web connector.
Have a good evening

 

Best regards

Mederic
Helper V
Helper V

Hello @v-xinruzhu-msft , @christinepayton ,

 

Thank you for your answers,
I'm trying to use a Folder URL starting with https://, by "SharePoint Folder" connector in Office 365 and not in Power BI.
When I use the full path, I get an error message
When I use part of the path for example: "https://kkkk.com/:f:/r/site/document"
This works but returns several tens of thousands of results with all the files and I stop the process manually after a few minutes.

I finally used the URL directly with the Excel file: "https://kkkk.com/:f:/r/site/document/....../...../....../ExcelFile.xlsm".
This path is very long but works.

I don't have administrator rights to try to understand or modify the SharePoint path parameters.


The original idea was to be able to select the most recent file in a folder.

 

Finally, using a VBA macro, I'm going to manually select the path to the Excel file in a cell and then send it to Power Query.

 

Thanks

Best regards

You can use the OData connector to get both the most recent file and path and have it directly in Power Query vs running a macro if you want. The SP Folder connector is more for combining Excel file data; if you don't need the content of the file it's much easier to use the OData. I did a video on it a ways back if it helps: https://youtu.be/yeIQ9jKln_I?si=quk3f-RaCxoDiOF2

christinepayton
Super User
Super User

The PBI folder connector requires the site URL, not the folder URL. You can then filter on the path in Power Query as one of the columns. SharePoint itself has limits on maximum path length, but if you're able to edit the file in SharePoint then it's probably okay. 

v-xinruzhu-msft
Community Support
Community Support

Hi @Mederic 

When you connect to Sharepoint folder online, you need to input the site url to the connection, you can refer to the following link.

https://learn.microsoft.com/en-us/power-query/connectors/sharepoint-folder#connect-to-a-sharepoint-f...

sharepoint.stackexchange.com

 

 

Best Regards!

Yolo Zhu

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

 

Mederic
Helper V
Helper V

After a bit of searching, I quickly came across this link. It is indeed a problem of length
Is there a solution without having to move the folder ?

File Path too long - Excel, Office 2019, Win 10, SharePoint - Microsoft Community

 

Best regards

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors