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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
cmeu
Advocate III
Advocate III

Web.Page() provides no results in service, works in desktop

Hello, I am trying to use Web.Page() to perform regular expression pattern matching. It is successful in the desktop environment, but not providing results when published to the service. I am not a gateway or capacity admin, and am on premium per capacity. This dataset requires no gateway, and I am unable to select one. 

This M-lang works in desktop, but fails in service. What is wrong here?

 

let
    fx_re = (text as text, pattern as text) as list => Web.Page("<script>document.write(new RegExp('"& pattern &"').exec('"& text &"'))</script>")[Data]{0}[Children]{0}[Children]{1}[Text],
    
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("TYw7DsIwEAWv8mIakCIk/tDScIF0UQoTNsTC9lpeB5TbcBZOhqFASK+Y4s3UtVosV+vNdrc/qFKdmC9wHL3x1wJVbwR5HUdMKtLuaAdCyuB0IikRLGkhRJLA/oLESB+lZX9naEGIuk2mpXlOaX/DyEOB6Tf7MNbinGs9gb0df18EloQussMgf+Ls9VRN8wY=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [id = _t, body.content = _t]),
    ct = Table.TransformColumnTypes(Source,{{"id", Int64.Type}, {"body.content", type text}}),
    #"do RegEx_extract" = Table.AddColumn(Table.Buffer(ct), "hashtag", each fx_re([body.content], "#[^\\s\\d]+[\\d\\w]+")),
    #"Removed Errors" = Table.RemoveRowsWithErrors(#"do RegEx_extract", {"hashtag"}),
    #"Expanded hashtag" = Table.ExpandListColumn(#"Removed Errors", "hashtag"),
    #"Filtered Rows" = Table.SelectRows(#"Expanded hashtag", each ([hashtag] <> "null") and not Text.StartsWith([hashtag], "#WO0") and Text.Length(Text.Trim([hashtag]))>3),
    #"Renamed Columns" = Table.RenameColumns(#"Filtered Rows",{{"id", "ht_conversation_id"}}),
    #"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"hashtag", type text}})
in
    #"Changed Type"

 

 

3 REPLIES 3
cmeu
Advocate III
Advocate III

Point of clarification - when I say it 'fails,' that is: It returns an empty dataset. There is no error and refresh succeeds normally.

Hi @cmeu 

 

What you might need is to put in a table that actually can be refreshed. Without something to refresh it wont actually do any updates.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

hey @GilbertQ - The embedded source table included above is meant to be representative of something else, for performing tests in relation to this thread. The actual source data is coming from a set of json files hosted in the same tenant on sharepoint.

Switching between the included table from binary and the sharepoint folder does not change the outcome

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.