Top Count vs. Pagination

Anonymous
2024-02-08T13:10:08+00:00

Can someone describe the difference between "Top Count" and "Pagination" when using the SharePoint "Get Items" action in Power Automate? I haven't seen any articles or videos that clearly demonstrate the difference.

Microsoft 365 and Office | SharePoint | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2024-02-08T17:01:02+00:00

    Hi respected Jason M. Bull,

    Thanks for your valuable feedback and sharing updates with us and I really appreciate your effort and your precious time doing. 

    And I appreciate your kind words.

    If you want to retrieve all items from a list that currently has 650 items, but may grow later, set this to a number slightly higher than your current list size to account for near-future growth, like 700. Pagination set the threshold to the maximum number of items you anticipate handling.

    If the list exceeds the Top Count and you haven't returned to adjust it, the flow will only process the first 700 items (if that was your Top Count), and you would miss the rest. However, with pagination enabled, it would process in batches of up to 700 until it reaches the pagination limit.

    For Scenario 2, the strategy is for Top Count leave this at its default value or set it to the maximum number of items.

    Since SharePoint has a List View Threshold of 5000 items, you'll need to paginate to process all 7000 items. However, since filters cut this down to 6500, you should set your pagination to a number that comfortably exceeds your filtered set.

    Your understanding and patience will be highly appreciated. I hope that you are keeping safe and well!

    Sincerely,

    Waqas Muhammad

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2024-02-08T13:29:01+00:00

    Dear respected Jason M. Bull,

    Good day! Thank you for posting to Microsoft Community. We are happy to help you.

    As per your description, using the SharePoint "Get Items" action within Power Automate, "Top Count" and "Pagination" are two different settings that relate to how many items are retrieved from a SharePoint list or library.

    Top Count:

    This setting specifies the maximum number of items to retrieve from the SharePoint list for a single operation. It's like setting a limit to how many items you want to be returned in one go. The purpose of this setting is to restrict the query to return only a specific number of items to ensure efficient data retrieval and processing. For example, if you set the Top Count to 100, the action will return only the first 100 items from the SharePoint list.

    Pagination:

    This setting affects how Power Automate handles larger sets of items that exceed the threshold set by the Top Count or the default SharePoint limit (which is typically 5000 items, commonly referred to as the List View Threshold). When you enable pagination, Power Automate will retrieve the items in "pages" or batches until all items are retrieved or until it reaches the maximum number of items that you specify for the pagination limit.

    Summary:

    In summary, "Top Count" is about setting a limit on the number of items to retrieve per request, while "Pagination" is about continuously making requests to retrieve all items in batches when you have more items than can be retrieved in a single request.

    Appreciate your patience and understanding and thank you for your time and cooperation.

    Sincerely,

    Waqas Muhammad

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2024-02-08T16:32:37+00:00

    Thanks Waquas. How would I handle these two scenarios:

    Scenario 1:

    I want to query a list of employees that has, say, 650 items. I will not perform any filter query, I will retrieve all 650 items, and send them an e-mail.

    How would I configure the Top Count and Pagination?

    Would I set the Top Count to, say 700 (in case more employees are hired later), and leave pagination unchanged? If the list ever exceeds 700, do I have to edit the flow to change the Top Count?

    Scenario 2:

    I want to query a list of sales invoices that has, say, 7000 items. I will perform a filter query which cuts this down to 6500 items that meet the criteria, and then update a column on those 6500 items.

    How would I configure the Top Count and Pagination?

    Would I leave the Top Count unchanged (as this list will definitely grow, and therefore I don't know how many to "expect"), and set the pagination to 5000? Or should Pagination be reduced to "page" smaller amounts of data to be processed?

    I guess I'm not sure why I would ever want to limit the number of items that are retrieved using Top Count, if there are more items in the list that meet my criteria? Is Pagination used to break the number of items down into smaller "batches", so that one batch can be processed while the next batch is being retrieved?

    Was this answer helpful?

    0 comments No comments