Skip to main content
Skip table of contents

Using Pagination Within Actions

Overview

This article outlines how to use pagination within supported actions, in order to work with more than 200 records at a time. By default, the iMIS connector only returns the first 200 records for a particular action. In this article, learn how to enable pagination so that your actions can work with (up to) 100,000 records.

Pagination

By default, the iMIS Connector will only return the first 200 records for a given action / query.

Why is pagination locked to 200 records per page?

Power Automate does not have the capability for the end-user to specify the page size in the workflow action. Despite iMIS supporting page sizes up to 500 records per page, as a balance between performance and API calls, a page size of 200 was chosen specifically for this connector.

Enabling Pagination

To enable pagination (on supported actions), click the … menu on the action and select Settings.

The action settings will appear. The first option should say Pagination.

First, enable pagination by switching the Pagination toggle on.

Next, you must enter a threshold which is the minimum number of items to return. (This cannot be blank.) This is the theoretical minimum number of records that you want to receive. You may receive more or less than this - see below.

Pagination Threshold

The threshold of items is driven by both the value you enter here, as well as the amount of items in the result set from iMIS.

For example, if you enter 1,000 as the threshold, but your query only returns 15 records, you will have a result set with 15 items in it.

If you enter a threshold of 5,000 items, but your iMIS result set contains 20,000 items, you will have a result set with 5,000 items in it.

Finally, the result set will always be a multiple of 200. For example, if you enter a threshold of 205 items (and assuming you have more than 400 items in iMIS), your result set will actually contain 400 items, because the results are only delivered in "pages" of 200 items, and Power Automate does not reduce your result set by fractions of pages.

In other words, your result set is always the lower of: the amount of items returned by iMIS or your provided Pagination Threshold, rounded up to the nearest 200. If pagination is not enabled, you will receive up to and not exceeding 200 items.

Working with a Specific Number of Records

If you need to work with a specific number of records that is not a multiple of 200, you will need to manually add steps in your Power Automate workflow that account for this.

For example, if you need to loop through up to but not exceeding 300 records, you can:

  • Initialize a numeric variable with a value of 0

  • Use the "Apply to each" action to loop through each record

  • Inside the "Apply to each" action, increment the numeric variable by 1.

  • Add a condition inside the "Apply to each" action which will check if your numeric variable is greater than or equal to 300. If yes, then stop processing more records.

Determining the Total Number of Records in an Output

If you need to know how many total records a particular action has fetched, especially when pagination is enabled, you'll need to write a custom expression.

In the expression editor, insert the function length(), then pace your cursor in between the ( ).

Below, you should see a search box to search through the dynamic fields. Search for the word "List". You should see "Contact List" or "Activity List" or "IQA Results" - these output variables represent the list of all results - for which the length() function will return the number of records in that list.

You can use this expression in a Conditional action to check if you have exactly the amount of records you were expecting, or if your results meets a minimum or maximum threshold.

You can also use the length() function to check if you have exactly one result, which is useful in contact matching scenarios where you want to search for a contact, and ensure that you have found exactly one match after searching.



JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.