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
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
Helper I
Helper I

@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
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.