Forum Discussion
Looping M code function for ServiceNow API
- 4 years ago
Disregard. I found a solution!
Here is my working table query:
let Source = List.Generate( () => [Offset = 10000, x = function_user(0)], each not List.IsEmpty( [x][result] ), each [offset = [Offset] + 10000, x = function_user([Offset]) ], each [x] ) in SourceThis video and article were a huge help: https://gorilla.bi/power-query/list-generate-api-calls/, https://www.youtube.com/watch?v=a_RJzoj1cnM.
Hopefully this helps someone else!
Hi Are you sure this refreshes in the service? I just implemented exactly the same query and it cannot be refreshed in the service as I get this error in the data source settings "You can't schedule refresh for this dataset because the following data sources currently don't support refresh".
My API call is also wrapped in a function and uses a relative path for all variables. I call the function in a loop so I can perform multiple API calls.
Are you able to confirm if your data source can be refreshed in the service and if the above actually worked as is?
Thanks