# Page count with Repeating Groups

**URL:** <https://forum.bubble.io/t/page-count-with-repeating-groups/73204>\
**Category:** Questions\
**Created:** [December 3, 2019, 7:51am UTC](https://forum.bubble.io/t/page-count-with-repeating-groups/73204 "2019-12-03T07:51:13Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![FJP](https://avatars.discourse-cdn.com/v4/letter/f/7993a0/32.png) [@FJP](https://forum.bubble.io/u/FJP)\
**Post date:** [December 4, 2019, 7:31am UTC](https://forum.bubble.io/t/page-count-with-repeating-groups/73204/4 "2019-12-04T07:31:35Z")

</div>

I will try give a more detailed explanation in the evening today

I have the repeating group in a Reusable element. But that can also be the page or group the RG is located.

**Custom States**

- first\_page
- current\_page
- last\_page
- current\_page\_start
- page\_size

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/c/f/cf80076f96e4e67a9c6df8aebbf4e072f3172292.png)

**Pagination - List of Numbers (plugin)**

- Length of list  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/5/3/53e8f9a6f2e09017830dc9783714bd817eb86989.png)

Workflow - Pageload

- Set current page to 1 (only when current\_page = 0)
- Calculate last page:  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/3/8/386c8adac469dc240d0e85746e8832342b3aa68b.png)
- Trigger Custom Event: Calculate current page start  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/e/8/e825559e52cc2df52a7f9ffccf04241c831de654.png)

Workflow - Previous (click)

- Set state current\_page to current\_page - 1
- Trigger Custom Event: Calculate current page start

Workflow - Next (click)

- Set state current\_page to: current\_page + 1
- Trigger Custom Event: Calculate current page start

Workflow - Pagenumber (click)

- Set state current\_page to: current\_page = current cell page number
- Trigger Custom Event: Calculate current page start

Data source Repeating group:

- :items from current\_page\_start
- :items until page\_size  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/1/6/16ec43d4484e87fa5d893ac040071306955eff7a.png)

---

_[View the full topic](https://forum.bubble.io/t/page-count-with-repeating-groups/73204)._
