Forum Discussion
rdorsey
1 year agoFrequent Visitor
Using List.Generate for Token-Based API Call
This is my first time building something like this and I'm missing something really fundamental. I built a function in M called "Output" which takes text as a parameter and runs an API call using ...
- 1 year ago
Your syntax doesn't look right to me.
Compare to the examples in this highly-related article:
How to use List.Generate to make API Calls in Power Query MCode snippet from the article:
List.Generate( () => [ Offset = 100, Pokemon = GetPokemon(0) ], each [Offset] <= 200, each [ Pokemon = GetPokemon( [Offset] ), Offset = [Offset] + 100 ], each [Pokemon] )Your code should probably look more like this:
List.Generate( () => [ token = "", results = Output("") ], each [results][EarliestEntryDate] > Date.FromText("6/15/2025"), each [ token = [results][continuationToken], results = Output(token) ], each [results] )
V-yubandi-msft
Community Support
1 year agoHi rdorsey ,
Could you please let us know if your issue has been resolved, or if you're still experiencing any problems? Feel free to share if you need any additional details we're happy to assist further.
Regards,
CST Team.