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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Sharepoint Web API Data Source Bug - Binary File Names with % character

There is an issue with Power BI Desktop where it will generate a Web.Contents error in a Power Query if trying to retrieve a Binary File from Sharepoint that has a "%" in its file name.

 

The work around is to rename affected files with a "%" character within the file names to something else like "pct"

 

Example API error below

 

BenW_0-1672802196419.png

 

BenW_1-1672802340535.png

 

 

Status: Needs Info
Comments
Anonymous
Not applicable

Hi @BenW 

If you change back to the previous % and refresh the data, will you still get the same error reported?

 

Best Regards,
Community Support Team _ Ailsa Tao

BenW
Regular Visitor

@Anonymous .  Here is simple test case setup.


Succesful Test:  Sharepoint file with no "%" in file name
1.  Create Sharepoint Excel file with 2 columns of test data.  Named to "Test.xlsx"

2.  Test simple Power Query to access the Binary with Sharepoint.Files

3.  Test successful

 

let
    Source = SharePoint.Files("https://sitename.sharepoint.com/sites/IntegratedZonePlanning/", [ApiVersion = 15]),
    #"Test xlsx_https://sitename sharepoint com/sites/IntegratedZonePlanning/Shared Documents/Water Quality IP/2 1 - Predictive Modelling Workstream/Supporting Doc/MSX Exports/Test File/" = Source{[Name="Test.xlsx",#"Folder Path"="https://sitename.sharepoint.com/sites/IntegratedZonePlanning/Shared Documents/Water Quality IP/2.1 - Predictive Modelling Workstream/Supporting Doc/MSX Exports/Test File/"]}[Content]
in
    #"Test xlsx_https://sitename sharepoint com/sites/IntegratedZonePlanning/Shared Documents/Water Quality IP/2 1 - Predictive Modelling Workstream/Supporting Doc/MSX Exports/Test File/"

 

BenW_0-1672916784682.png

 

 

 

Failed Test: Sharepoint file with "%" in file name

Same test steps and Power Query, but now with file name containing "%".  Only difference in Power Query is Sharepoint.Files now asked to retrieve a Binary file "Test 40%.xlsx"

 

Query fails with Web.Contents 404 error

BenW_2-1672917129055.png

 

 

 

 

BenW_1-1672916856055.png

 

let
    Source = SharePoint.Files("https://sitename.sharepoint.com/sites/IntegratedZonePlanning/", [ApiVersion = 15]),
    #"Test 40% xlsx_https://sitename sharepoint com/sites/IntegratedZonePlanning/Shared Documents/Water Quality IP/2 1 - Predictive Modelling Workstream/Supporting Doc/MSX Exports/Test File/" = Source{[Name="Test 40%.xlsx",#"Folder Path"="https://sitename.sharepoint.com/sites/IntegratedZonePlanning/Shared Documents/Water Quality IP/2.1 - Predictive Modelling Workstream/Supporting Doc/MSX Exports/Test File/"]}[Content]
in
    #"Test 40% xlsx_https://sitename sharepoint com/sites/IntegratedZonePlanning/Shared Documents/Water Quality IP/2 1 - Predictive Modelling Workstream/Supporting Doc/MSX Exports/Test File/"