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

Web.Contents working in Power Query but not on Load

I am running a simple HTTP request to return a CSV from a service. I first use the Source step to request that a report is run, I then parse the output to get a runId variable which I then plug into the main request. Since the report takes 10-15 seconds to run i use the Function.InvokeAfter to be sure it's done before I get the report.

let
    Source = Json.Document(Web.Contents("url to run the report", [Headers=[#"Content-Type"="type", Accept="type", Authorization="API key"], Content=Text.ToBinary("body method")])),
    params = Source[params],
    runId = Text.From(params[runId]),
    doc = Function.InvokeAfter( () => Csv.Document(Web.Contents("url to get the report"&runId&".csv", [Headers=[#"Content-Type"="type", Authorization="API key"]]),[Delimiter=",", Columns=33, Encoding=65001, QuoteStyle=QuoteStyle.Csv]),#duration(0,0,1,0))
in
    doc

 

 

 This works as expected in the Power Query window returning the report. However every time I close and load into the Report Builder I get a 404 error:

404.png

I assumed it was to do with the wait time but I changed it to 5 and 10 minutes which made no difference (while still returning correctly in Power Query after the delay).

 

Any suggestions? What could cause difference behavior outside of Power Query?

0 REPLIES 0

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.