Dynamic # of Pagination Buttons Based on api response

Hi, I’m using an api that returns a bunch of images in addition to a value called “# of pages”. If “# of pages”=10 for example, I’d like to show 10 buttons (or selectors) labeled 1,2,3,4,…10. If # of pages=5, then buttons 1,2,3,4,5. How can I do this?

This is used for pagination of the image results.

You could create an option set of numbers from 0 to 100 (or more), let’s call it “Numbers_100”

Then on your page you place a repeating group of type “Numbers_100” and as a data source you will find the X first Numbers_100 with X being the number returned from the API.

Then, in each cell of the repeating group, place a button and do what you want with it.