cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dpi
Regular Visitor

Web.Content behaves differently with local file than with file stored in sharepoint document library

Hi folks,

 

I have a html document, delivered by a SAP scheduled job. I can store it on my local drive c: and I'm able to load it in Power Query using this:

let
    Quelle = Web.Page(Web.Contents("C:\Users\xxx\OneDrive\Power BI\Job.htm")),
    #"Andere entfernte Spalten" = Table.SelectColumns(Quelle,{"Data"}),
    #"Erweiterte Data" = Table.ExpandTableColumn(#"Andere entfernte Spalten", "Data", {"Column1", "Column2", "Column3"})
in
    #"Erweiterte Data"

That worked fine, so I attempted to change the file location to sharepoint document library so I could automate the update of the report in power bi service.

let
    Quelle = Web.Page(Web.Contents("https://mycompany.sharepoint.com/sites/mysharepoint/Shared Documents/General/Job.htm")),
    #"Andere entfernte Spalten" = Table.SelectColumns(Quelle,{"Data"}),
    #"Erweiterte Data" = Table.ExpandTableColumn(#"Andere entfernte Spalten", "Data", {"Column1", "Column2", "Column3"})
in
    #"Erweiterte Data"

But now the result of the very same code is an empty table.

 

I really just put a copy of that html file stored in sharepoint onto my local c: drive.

 

Can anybody give me a hint what I can do to get the same result from the sharepoint location as from c:?

 

 

Best Regards

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @dpi ,

 

There is only "Text" in Desktop, no "HTML" format, so my guess is that your column in SharePoint is flagged as Rich Text versus Plain Text so you would need to change the column type in SharePoint, then it should strip out the HTML. Please refer to this case.

 

https://community.powerbi.com/t5/Desktop/SharePoint-HTML-conversion-for-column-values/td-p/15417

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

4 REPLIES 4
tonyk86
Frequent Visitor

@dpi  - did you ever resolve this? I'm also running the same issue. I have no issues getting opening the HTML file from my local drive but when i attempt to open the HTML file stored in my SharePoint site (via PowerQuery), it either gives me error (either resource error or credential error). The strange part is that it only does this for HTML files. I have no issues with opening other files in PowerQuery that is on my SharePoint site. 

MeiZhi
Regular Visitor

Hi dpi, Have you resolved your issue? I faced the same as you now. if you have anyting can be shared?

 

v-frfei-msft
Community Support
Community Support

Hi @dpi ,

 

There is only "Text" in Desktop, no "HTML" format, so my guess is that your column in SharePoint is flagged as Rich Text versus Plain Text so you would need to change the column type in SharePoint, then it should strip out the HTML. Please refer to this case.

 

https://community.powerbi.com/t5/Desktop/SharePoint-HTML-conversion-for-column-values/td-p/15417

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi Frank,

 

thanks. Your suggestion might work for a sharepoint list. But in my scenario, I just store a .html file in the sharepoint document library. So, there are no column types that I could possibly change.

 

Best regards,

dpi

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors