Reapeating Group Best Practices and challange :)

I have some issues regarding the Repeating Group solutions and I would like to discuss them.

I am building a repeating group displaying client orders and I would like to know which way to go.

  1. Regarding the repeating group pagination (I want to display 15 items, have 5 buttons to switch (first, -1, current, +1, last) - what is the best approach - custom states, toolbox or some other solutions?
    I want speed but also simplicity in programing as I need to program many pagination pages.

  2. Regarding marking first and last items on the list - I can easily create condition for item index 1 - which is alwasy the first, but is there a way, without using workflow to create a custom state, a way to refer to a last item index nr?

Would welcome any feedback :slight_smile:

None of the above. Each button just has a different workflow (go to page 1, go to page current page number - 1, go to page current page number, go to page current page number + 1, and go to last page. Make sure the -1/+1 buttons aren’t clickable if it’s on the firstpage/last page respectively.

Index = repeating group’s list of X:count is the last item of the repeating group

1 Like

Regarding this part - Of course, every button has a workflow. I get what you mean is functionality based on the in build page nrs of a a repeating group correct?

image

But does the repeating group have the page count parameter - as I need to hide some buttons depending on the item count (especially that they can be filtered from 100 pages to just 1).
Or maybe I do not need the total count to display them properly…

Yes

Page count is just RG’s List of X:count / [items per page]:ceiling (rounded up)

1 Like

And out of curiosity - what is the bestway to refer to number of currently displayed elements (ex. 30-45 out of 155) - can I address that with this page nrs as well? (as I was using some complicated custom state logic :slight_smile: )

Start of page item # is (1 + ((RG’s page number-1) * number of item’s per page))

End of page item # is (number of item’s per page + ((RG’s page number-1) * number of item’s per page))

1 Like

Many, many thanks George!

And now I removed the state I created called current page - so how can I make +1 without having it in the program. As is there a way to refer to a page we are on, without it?
(I was sure it was added as a feature, but then realized it was my own creted custom state :smiley: )

Go to next of repeating group

The expressions might look scary to display the first and last item number on each RG page but it’s way more maintainable than manually setting the first and last item number every time you change the RG page. Even better if you use a variable for the number of items per page rather than hard coding it multiple times so that if you change the number of items per page you only have to update the RG settings and the variable itself.

You could have an invisible group and give it a name so you know its a variable, type of content to be number, and then put that dynamic expression in (RG's List of Things:count / [items per page]:ceiling).

After that, you have a variable that is easily referenced and updated.

Okay, not sure if I gave absolutely any value or if I even helped answer the last part of the question, but it was worth a valiant effort.

Hi George, which plugin do you use to calculate those formulas?

None, the expression composer