Story-based pagination gives you complete control over the pagination logic by building it manually using actions. This approach is useful when you need custom logic, want to add delays between requests, or need to transform data between pages.
The core pagination loopΒ
At its heart, pagination via story build is about creating a loop. Make a request, check if there are more pages, and if so, make another request. This loop continues until you've retrieved all the data.
Here's the basic flow:
Make the initial request: Use an HTTP Request action to call the API endpoint.
Check for more pages: Use a Condition action to evaluate whether additional pages exist.
Insert delays: Utilize the delay mode of the Event Transform action to avoid API rate limiting.
Make subsequent requests: If more pages exist, loop back to make another request.
End the loop: When no more pages remain, exit the loop and process the collected data.
Let's walk through an example of building pagination logic within a story.
βοΈImportant
ποΈ Try this: Paginate example via story buildΒ
New to emulations? Swap between watch, try, or scroll mode.
Handle pagination resultsΒ
Once you've retrieved multiple pages of data, you need to decide how to process them. Tines Stories gives you two main approaches: exploding results to process each item individually, or merging results to work with the complete dataset at once.
Explode pagination resultsΒ
Exploding pagination results allows you to process each individual item from all pages separately, which is useful when you need to enrich, transform, or take action on each record independently.
ποΈ Try this: Explode pagination resultsΒ
New to emulations? Swap between watch, try, or scroll mode.
Merge pagination resultsΒ
Merging pagination results combines all pages into a single array, which is useful when you need to work with the complete dataset at once, such as generating a report or performing aggregate analysis.
ποΈ Try this: Merge pagination resultsΒ
New to emulations? Swap between watch, try, or scroll mode.