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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Implementing "Value.WaitFor" in PowerBI DataFlow

Hi experts!

 

In my dataflow that consumes a REST API I come across HTTP 429 "Too many requests" errors which break the dataflow refresh.

 

I have copied all queries to my PowerBI Desktop and implemented the 'Value.WaitFor' to overcome the issues with the 'HTTP 429' Status.

 

Finally, I used the code supplied here: https://gist.github.com/CurtHagenlocher/68ac18caa0a17667c805 

 

So, now I have moved the queries back to the dataflow, The preview of the Queries works fine. 

 

But when I am Saving the DataFlow, the message

 

Can't save dataflow

One or more entities references a dynamic data source.

 

image.png

 

I really hope that someone here has a workaround or a proper solution. This is a major blocker for us.

 

Thanks for reading!

 

Best,

 

Denis

3 REPLIES 3
iBusinessBI
Kudo Collector
Kudo Collector

Have you find a solution? Same issue.

v-easonf-msft
Community Support
Community Support

Hi , @Anonymous 

Please check whether the solution in this document coild help:

Issues-with-using-a-parameter-in-web-content-url-in-dataflow 

 

Best Regards,
Community Support Team _ Eason

Anonymous
Not applicable

Hi @v-easonf-msft !

Thanks but I am already using the RelativePath and Query options together with Web.Contents. 

That's my big frustration. The base URL is always the same (server name) but still, the error suggests that I am using a dynamic URL.

As you can see in my screenshot, the Web.Contents method always gets the same parameter value:

 

denisthemenace_0-1616136354051.png

 

(url as text, optional options as record) => 

let
    WaitFor = 
        (producer as function, interval as function, optional count as number) as any =>
                let
                    list = List.Generate(
                        () => {0, null},
                        (state) => state{0} <> null and (count = null or state{0} < count),
                        (state) => if state{1} <> null
                            then {null, state{1}}
                            else {1 + state{0}, Function.InvokeAfter(() => producer(state{0}), interval(state{0}))},
                        (state) => state{1})
                in
                    List.Last(list)

in

WaitFor(
        (i) =>
            let
                options2 = if options = null then [] else options,
                options3 = if i=0 then options2 else options2 & [IsRetry=true],
                result = Web.Contents(#"Jira Endpoint", options3 & [ManualStatusHandling={429}]),
                buffered = Binary.Buffer(result), /* avoid risk of double request */
                status = if buffered = null then 0 else Value.Metadata(result)[Response.Status],
                actualResult = if status = 429 then null else buffered
            in
                actualResult,
        (i) => #duration(0, 0, 0, i*0.1), 10
        )

 

Best, Denis

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors
Top Kudoed Authors