Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Passing list items to functions with different argument requirements

I am attempting to have a function call an API request for each day of the year. I want to achieve this by having the function "Query2" make a call for each day which is provided by a pre-generated l...
  • Zubair_Muhammad's avatar
    7 years ago

    Anonymous 

     

    #date function needs 3 paramaters.

    Perhaps adjust the function as follows

     

    (dayDate as date) as table =>
    let
        Source = Xml.Tables(Web.Contents("https://API.EXAMPLE.com/api/stats/groups/104/interactions?d=" & 
    Date.ToText(#date(Date.Year(dayDate),Date.Month(dayDate),Date.Day(dayDate))))), Table0 = Source{0}[Table], #"Changed Type" = Table.TransformColumnTypes(Table0,{{"media-type", type text}, {"origination", type text}, {"create-timestamp", type datetimezone}, {"wrap-up-code", type text}, {"wrap-up-text", type text}, {"is-interaction-completed", type logical}}) in #"Changed Type"