Forum Discussion
"Unexpected error" when reading sharepoint folder full of large text files using Dataflows
Initially msft concluded that it was a file type issues but after testing that was deemed to not be the case. Your issue with Excel files contributes to that view.
I'll link your comment to my case and keep you updated.
Thank you for replying Accokeekian .
My Excel files have .xlsm extension so it doesn't seem to be the file type. I leave you the mashup text, it might be useful somehow (translated from spanish):
section Section1;
shared data_oferta_prog = let
Source = SharePoint.Files("https://xxxxxxxxxxx.sharepoint.com/sites/xxxxxxxxxxx", [ApiVersion = 15]),
#"Filtered rows" = Table.SelectRows(Source, each ([Extension] = ".xlsm")),
#"Keep content" = Table.SelectColumns(#"Filtered rows", {"Content"}),
#"Filtered hidden files" = Table.SelectRows(#"Keep content", each [Attributes]?[Hidden]? <> true)
in
#"Filtered hidden files";
shared #"Example file" = let
Source = SharePoint.Files("https://xxxxxxxxxxx.sharepoint.com/sites/xxxxxxxxxxx", [ApiVersion = 15]),
#"Filtered rows" = Table.SelectRows(Source , each ([Extension] = ".xlsm")),
#"Keep content" = Table.SelectColumns(#"Filtered rows", {"Content"}),
#"Filtered hidden files" = Table.SelectRows(#"Keep content", each [Attributes]?[Hidden]? <> true),
Navegation = #"Filtered hidden files"{0}[Content]
in
Navegation;
shared Parameter = let
Parameter = #"Example file" meta [IsParameterQuery = true, IsParameterQueryRequired = true, Type = type binary]
in
Parameter;
Thanks!
- jmdh6 years ago
Advocate IV
Hope this helps: I have faced the same issue many times.
Now i prefer to use SharePoint.Contents instead of SharePoint.Files which is both easier to reach the files i want ie (their folder) and seems to work well.This unexpected error has started in may or June i believe and no one seems to have acknoledged it.
I would love an extension to the API allowing to directly access a given folder.
- fabo6 years ago
Advocate III
Hi jmdh , thank you for your suggestion.
Unfortunately, it didn't workout for me. I can summarize the steps for both methods as followed:
Using SharePoint.Files
1. Source = SharePoint.Files("https://xxxxx.sharepoint.com/sites/xxxxx", [ApiVersion = 15])
2. #"Keep Content" = Table.SelectColumns(Source ,{"Content"})
Using SharePoint.Contents
1. Source = SharePoint.Contents("https://xxxxx.sharepoint.com/sites/xxxxx", [ApiVersion = 15])
2. #"Shared Documents" = Source{[Name="Shared Documents"]}[Content]
3. Data = #"Shared Documents"{[Name="Data"]}[Content]4. #"Keep Content" = Table.SelectColumns(Data ,{"Content"})
With both approaches I come to the same next step: combine files (expand the content), selecting the two down arrows next to the field name Content.
That's the point where I get this unexpected error, no matter which of the previous functions I use.
- jmdh6 years ago
Advocate IV
May sound dumb but does it work on PowerBI Desktop ?