Skip to main content

4 replies

konduruc733182
August 10, 2023

Hello harmanjots514,

You need to consider taking two local variables one for your start index and one for your batchSize. Have defaults as 1 and 500 respectively. Now when you want to fetch the next batch, use a richText and provide dynamic link which will update these two variables to 501 and 1000 respectively.

I hope this will help.

stefanhelzle0001
Brainy
August 10, 2023

Got you covered: appian.rocks/.../

mikes0011
Brainy
August 10, 2023

What's your use case?

The Expression Guru
jamesm4933
August 10, 2023

Given:

p = page number - 1

w = batch size (or width)

Your startIndex will be: p*w+1

p needs to be 0 based to get the arithmetic to work, which is why you need to subtract 1.  

Remember to do bounds checking in your buttons, so you don't end up at page number -1, for instance.

You will also likely have to make an allowance for the last page. 

The last page will start at: if(mod(totalCount, w) = 0, totalCount-w+1, totalCount - mod(totalCount, w)+1), and it will return if(mod(totalCount, w) = 0, w, mod(totalCount, w)) entries.

So, just don't assume that you can index a full page width, unless you have verified that you are NOT on the last page.

Edit: Had to add the ifs.