Jae Wilson @DataCrew
Domo

My first Domo CodeEngine function -- handling loops and pagination (Part 2)

April 26, 2024

Hook

Most Domo APIs won't return more than 50 records at a time — and if your CodeEngine function only calls an endpoint once, you're silently missing data.

Why It Matters

Pagination is one of those problems that doesn't announce itself. Your function runs, returns results, and looks correct — until you realize you only got the first page. Without a reusable loop pattern, every API-backed CodeEngine function needs its own pagination logic bolted on. A well-designed looper abstraction means you write the pattern once, handle both common pagination styles, and never silently truncate results again. This is the foundational plumbing that makes CodeEngine viable for real production integrations against Domo's Groups, Users, Datasets, and similar paginated endpoints.

What You'll Learn

  • Understand why Domo APIs return paginated results and what default limits look like
  • Build a reusable looper function that handles both URL query parameter and request body pagination styles
  • Configure loop_config with offset, limit, maximum, and loop_until_end options
  • Distinguish when to pass pagination parameters as query params vs. POST body fields
  • Chain the looper with the authentication pattern from Part 1 to make authenticated, paginated API calls