none
Wait time between API calls in Power Query RRS feed

  • Question

  • I have the following function I pass many URL's to doing this #"Added Custom" = Table.AddColumn(#"First Row as Header", "Custom", each SharedCount ([URL])),

    I would like to add in a wait time between calls. I saw some posts by Chris Webb using Function.InvokeAfter but was not able to get it working with this function. Any ideas how to add in a few second wait time?

    let
     GetCounts = (URL as text)=>
    let
     Source = Json.Document(Web.Contents("https://free.sharedcount.com/url?apikey=myapikey&url="&URL&""))
    in
         Source
    in
         GetCounts

    Thursday, June 25, 2015 3:54 PM

Answers

All replies

  • Can you tell us more about what didn't work for you with Function.InvokeAfter? I don't believe there would be another reasonsable solution for what you're looking for.
    Thursday, June 25, 2015 5:00 PM
    Moderator
  • I was getting a Cannot convert a value of type Table to type Function error message and was unable to find a work around for it. I was trying to put it in the function.
    Thursday, June 25, 2015 8:32 PM
  • You need to pass a function to Function.InvokeAfter and not the table returned by Web.Contents. See this blog post that explains how to use it.
    Saturday, June 27, 2015 12:29 AM
    Moderator