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 ,
Thank you for reaching out to the Microsoft Fabric Community. AlexisOlson , has provided an good solution that follows recommended practices for using List.Generate, particularly for managing token based API pagination.
We encourage you to try this approach with your data and share your experience. Should you have any further questions or encounter any issues, please feel free to reach out.
Special thanks to AlexisOlson, for the quick and detailed response.
Best regards,
Fabric Community Team.