CubedFluidity's avatar
CubedFluidity
Frequent Visitor
6 years ago
Status:
New

Error Handling for "Expression.Error: Access to the resource is forbidden"

This is an Power Query M issue in excel. I combine data from an excel file in sharepoint.

 

A user changed his connection settings. There was no error message when the user ran his query. 

 

The Error Record does not produce a value (Source[HasError] should produce a boolean value). 

 

let
Source = try SharePoint.Files("https://xxxxxxxxx.sharepoint.com/sites/MHCR", [ApiVersion = 15]),
TestForError = if Source[HasError] then error "There is an error connecting to https://xxxxxxxxx.sharepoint.com/sites/MHCR" else Source
in
TestForError

 

To test the error, I set the user access to anonymous to force an error: