Pagination in Power Automate
In this exercise, we will learn about the pagination and threshold limits in Power Automate. These are important concepts when working with connectors, especially when dealing with large datasets. Let me break down these concepts and explain how to use them.
Pagination:
Pagination is the process of dividing a large set of data into smaller chunks or pages. When working with APIs or connectors that return a large volume of data, pagination ensures that the data is retrieved in manageable portions, preventing performance issues, and reducing the load on both the data source and the Power Automate service.
When an action in Power Automate retrieves data, the connector may not return all the records at once, especially if there are thousands or millions of records. Instead, it returns a subset of the records and includes information on how to retrieve the next set of records. Power Automate handles this automatically, but we need to be aware of it, especially if we are designing flows to work with large datasets.
Threshold Limit:
Threshold limits refer to the maximum number of records that can be processed or retrieved in a single request. Many APIs and connectors enforce these limits to ensure system performance. Exceeding these limits might result in errors or degraded performance.
To enable the pagination for the connector in the power automate flow, follow the following steps:
Step 1: Select connector and click on the three ellipses (...) for the connector.
Note: • By default, the pagination limit is 256 for "List rows present in a table" from Excel Online.
• By default, the pagination is off for the connectors.
Step 2: In the settings menu enable Pagination option and specify the Threshold limit in the settings pane.
Note: The Threshold limit should be a number greater than 0 and less than or equal to 100000 (1 Lakh). Do not leave the threshold limit to empty otherwise pagination does not work.
Step 3: After do the configuration select Done to save the configuration.
Step 4: And click on Save to save the power automate flow.
Note: Pagination retrieves the items to meet the specified threshold by following the continuation token. Due to connector's page size, the number returned may exceed the threshold.
For example, we know that by default, the pagination limit is 256 for "List rows present in a table" from Excel Online. If we choose the Threshold limit to 300 even though due to the pagination size of the connector it retrieves 256 * 2 (512 rows from the excel table) not 300. Basically, it returns the data from the data source in the multiples of its page size.