$customHeader
Skip to end of banner
Go to start of banner

Example 1: Use Pagination to fetch records

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

This example Pipeline demonstrates how to use the Pagination functionality provided by the TestRail API. All the TestRail bulk APIs return a maximum of 250 records on every request.

Prerequisites: A valid account to access the resources from the endpoint.

Steps

  1. Configure the Request Method with the GET method and the URL with the endpoint from where you want to fetch the records.

  2. Validate the HTTP Client Snap with the above configuration. The Snap displays the following output:

  3. Based on the output, configure the Has Next condition so that the Snap evaluates to true when the 'next' value in the output page is not null. The condition returns false when the 'next' value in the output is null. Configure the Next URI by appending the Has Next value to the URI.

  4. Validate the Snap. After validation, the output displays two entities, each of which is a page containing 250 records.

  5. When the Total Pages to Fetch field is blank, the Snap continues paginating until all records are fetched or the connection times out.

  6. Validate the Snap. The Snap displays the following output when you do not configure the Total Pages to Fetch field.

The Snap fetches 250 records each time. You can see that the previous value is null and the next value is not null.

Here, the Snap fetches the next 250 records (251 through 500).

The following is the HTTP Client output when the next value is null, which means that no more records are left and the Snap has fetched all 25, 500 records.

Download the Pipeline.

  • No labels