Forum Discussion
benryon1
6 years agoMicrosoft Employee
Delay an API call from a custom column
I have an API that has a rate limit of one call per second. I'm using a custom column and add the following code below. The actual quaery is in Column 1. How do I add a delay to avoid the rate limit wtihin the code for the custom column, further below?
I've seen other answers for using Function.InvokeAfter within the Advanced Editor, but have zero clue how to translate it into what I'm doing with a custom column. Very new to API's, somewhat moderate under the hood of Power BI.
= Json.Document(Web.Contents("https://api.xxxxxx.com/search/articles.json?q=" & [Column1] & "&api_key=XXXXXX"))
3 Replies
- Greg_DecklerCommunity Champion
- benryon1Microsoft Employee
Yes! That video is it. Final conditional column code works out to be what I have below, with the missing URL data in Column 2 (for reference for anyone in the future):
= Function.InvokeAfter(()=> Json.Document(Web.Contents("https://api.xxxxxxxx.com/search/articles.json?q=" & [Column2] & "&api_key=xxxxxxxx")),#duration(0,0,0,1))