cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ermak Frequent Visitor
Frequent Visitor

Loop the query and pause between requests

Hello. Ask for help.

I'm taking data from the API through a function. If the data is not ready, the API gives the message "Your report is not ready yet, try to update it later". Then I need to wait 10-20 seconds and update the request. Sometimes I need to update 2-3-5 times, depending on the amount of data.

Is it possible to loop the query until it returns data instead of the phrase "Your report is not ready yet..."? And can I set a pause between requests?

 

let
    Source = PQYD(Date_and_API{0}[APID], null, "Date,Impressions,Clicks,Ctr,Cost,AvgCpc,AvgClickPosition,CampaignName,AdGroupName,Criteria,AdNetworkType,LocationOfPresenceName", "CRITERIA_PERFORMANCE_REPORT", Date_and_API{0}[30 days ago], Date_and_API{0}[Yesterday])
in
    #"Source"

image.png

 

After a few updates

image.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Loop the query and pause between requests

@ermak ,

 

Power query supports loop/iteration but doesn't support function like pause/sleep, about the workaround, I would suggest you to refer to similar thread:

https://community.powerbi.com/t5/Desktop/Query-to-Scrap-URLs-with-a-pause-every-xx-URLs/td-p/352809

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Loop the query and pause between requests

@ermak ,

 

Power query supports loop/iteration but doesn't support function like pause/sleep, about the workaround, I would suggest you to refer to similar thread:

https://community.powerbi.com/t5/Desktop/Query-to-Scrap-URLs-with-a-pause-every-xx-URLs/td-p/352809

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)