Get defined data from json response

Hi Koders,
I didn’t understand from where should I start to solve this ?

I have json response of 100 items of a list.
I wants to get data like this ;
When user start app first then get value of 20 items from json response and I have two buttons for next and previous. when user click on next button then get value of next 20 items from response and so on.
But when user click on previous button then get value of previous 20 items from response.

Make it as procedure… and try. When user hits next just change the starting and end point.

1 Like

And when previous button click.

Make previous button to visible only if user hits next until let it be in hidden mode also assign stating and ending point.

If you show the way how you extract the JSON it will be easy for others to give their ideas…

Did You try?

Use the current start and current end ( for eachIndex ) Depending on the button clicked, you will either increase these values or decrease them.
And control the lowest value and the highest value, the lowest will be 1 and the highest will be the number of items). It cannot be less than 1 or greater than the number of items.

2 Likes

Thanks for your reply but I have already tried with same method as you tell and I have successfully able to solve my problem really.

Solved With what suggestion? :+1:

Added two variables as initial and next data and set there values to 1 and 10 . Once next button click increase both the values by 10 and if previous button click then decrease both the values by 10.
Then get values from list with number by for each from to block.

https://docs.kodular.io/blocks/control/#forrange

and this control too… :+1:

1 Like

Yes, this too

1 Like