iMIS Power Suite - Power Automate Connector
Using pagination within actions
By default, the iMIS Power Automate Connector only returns the first 200 records for a particular action. Learn how to enable pagination so that your actions can work with (up to) 100,000 records below:
Pagination
By default, the iMIS Power Automate Connector will only return the first 200 records for a given action or query.
Note: iMIS Power Automate Connector 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) do the following:
- 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, enter a threshold. This sets the minimum number of items to return. The actual result set is always the lower of your threshold or the number of items returned by iMIS, and it is rounded up to the nearest 200. For example, a threshold of 205 returns 400 items when sufficient data exists. Disabling pagination limits the result set to 200 items.
Note: This field cannot be left blank.
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, do the following:
- 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. Do the following:
- 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.
- 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.
Note: 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.