|
| 1 | +--- |
| 2 | +title: Get more data, items, or records with pagination - Azure Logic Apps |
| 3 | +description: Set up pagination to exceed the default page size limit for connector actions in Azure Logic Apps |
| 4 | +services: logic-apps |
| 5 | +ms.service: logic-apps |
| 6 | +ms.suite: integration |
| 7 | +author: ecfan |
| 8 | +ms.author: estfan |
| 9 | +ms.reviewer: klam, LADocs |
| 10 | +ms.topic: article |
| 11 | +ms.date: 04/11/2019 |
| 12 | +--- |
| 13 | + |
| 14 | +# Get more data, items, or records by using pagination in Azure Logic Apps |
| 15 | + |
| 16 | +When you retrieve data, items, or records by using a connector action in |
| 17 | +[Azure Logic Apps](../logic-apps/logic-apps-overview.md), you might get |
| 18 | +result sets so large that the action doesn't return all the results at |
| 19 | +the same time. With some actions, the number of results might exceed the |
| 20 | +connector's default page size. In this case, the action returns only the |
| 21 | +first page of results. For example, the default page size for the SQL Server |
| 22 | +connector's **Get rows** action is 2048, but might vary based on other settings. |
| 23 | + |
| 24 | +Some actions let you turn on a *pagination* setting so that your logic |
| 25 | +app can retrieve more results up to the pagination limit, but return those |
| 26 | +results as a single message when the action finishes. When you use pagination, |
| 27 | +you must specify a *threshold* value, which is the target number of results you |
| 28 | +want the action to return. The action retrieves results until reaching your |
| 29 | +specified threshold. When your total number of items is less than the specified |
| 30 | +threshold, the action retrieves all the results. |
| 31 | + |
| 32 | +Turning on the pagination setting retrieves pages of results based on a connector's page size. |
| 33 | +This behavior means that sometimes, you might get more results than your specified threshold. |
| 34 | +For example, when using the SQL Server **Get rows** action, which supports pagination setting: |
| 35 | + |
| 36 | +* The action's default page size is 2048 records per page. |
| 37 | +* Suppose you have 10,000 records and specify 5000 records as the minimum. |
| 38 | +* Pagination gets pages of records, so to get at least the specified minimum, |
| 39 | +the action returns 6144 records (3 pages x 2048 records), not 5000 records. |
| 40 | + |
| 41 | +Here's a list with just some of the connectors where you |
| 42 | +can exceed the default page size for specific actions: |
| 43 | + |
| 44 | +* [Azure Blob Storage](https://docs.microsoft.com/connectors/azureblob/) |
| 45 | +* [Dynamics 365](https://docs.microsoft.com/connectors/dynamicscrmonline/) |
| 46 | +* [Excel](https://docs.microsoft.com/connectors/excel/) |
| 47 | +* [HTTP](https://docs.microsoft.com/azure/connectors/connectors-native-http) |
| 48 | +* [IBM DB2](https://docs.microsoft.com/connectors/db2/) |
| 49 | +* [Microsoft Teams](https://docs.microsoft.com/connectors/teams/) |
| 50 | +* [Oracle Database](https://docs.microsoft.com/connectors/oracle/) |
| 51 | +* [Salesforce](https://docs.microsoft.com/connectors/salesforce/) |
| 52 | +* [SharePoint](https://docs.microsoft.com/connectors/sharepointonline/) |
| 53 | +* [SQL Server](https://docs.microsoft.com/connectors/sql/) |
| 54 | + |
| 55 | +## Prerequisites |
| 56 | + |
| 57 | +* An Azure subscription. If you don't have an Azure subscription yet, |
| 58 | +[sign up for a free Azure account](https://azure.microsoft.com/free/). |
| 59 | + |
| 60 | +* The logic app and the action where you want to turn on pagination. |
| 61 | +If you don't have a logic app, see |
| 62 | +[Quickstart: Create your first logic app](../logic-apps/quickstart-create-first-logic-app-workflow.md). |
| 63 | + |
| 64 | +## Turn on pagination |
| 65 | + |
| 66 | +To determine whether an action supports pagination in the Logic App Designer, |
| 67 | +check the action's settings for the **Pagination** setting. This example shows |
| 68 | +how to turn on pagination in the SQL Server's **Get rows** action. |
| 69 | + |
| 70 | +1. In the action's upper-right corner, choose the |
| 71 | +ellipses (**...**) button, and select **Settings**. |
| 72 | + |
| 73 | +  |
| 74 | + |
| 75 | + If the action supports pagination, |
| 76 | + the action shows the **Pagination** setting. |
| 77 | + |
| 78 | +1. Change the **Pagination** setting from **Off** to **On**. |
| 79 | +In the **Threshold** property, specify an integer value for |
| 80 | +the target number of results that you want the action to return. |
| 81 | + |
| 82 | +  |
| 83 | + |
| 84 | +1. When you're ready, choose **Done**. |
| 85 | + |
| 86 | +## Workflow definition - pagination |
| 87 | + |
| 88 | +When you turn on pagination for an action that supports this capability, |
| 89 | +your logic app's workflow definition includes the `"paginationPolicy"` |
| 90 | +property along with the `"minimumItemCount"` property in that action's |
| 91 | +`"runtimeConfiguration"` property, for example: |
| 92 | + |
| 93 | +```json |
| 94 | +"actions": { |
| 95 | + "HTTP": { |
| 96 | + "inputs": { |
| 97 | + "method": "GET", |
| 98 | + "uri": "https://www.testuri.com" |
| 99 | + }, |
| 100 | + "runAfter": {}, |
| 101 | + "runtimeConfiguration": { |
| 102 | + "paginationPolicy": { |
| 103 | + "minimumItemCount": 1000 |
| 104 | + } |
| 105 | + }, |
| 106 | + "type": "Http" |
| 107 | + } |
| 108 | +}, |
| 109 | +``` |
| 110 | + |
| 111 | +## Get support |
| 112 | + |
| 113 | +For questions, visit the |
| 114 | +[Azure Logic Apps forum](https://social.msdn.microsoft.com/Forums/en-US/home?forum=azurelogicapps). |
0 commit comments