Generating a dropdown of page numbers?

I’m fetching a list of items from an API call. The response provides the total number of pages (given the items per page specified in the call). I’ve got pagination working just fine with Next Page and Prev Page buttons as well the ability to go directly to a page by typing the page number into an input field.

However, I’d like to replace the input with a dropdown of available pages. Anyone have an idea, given a number (total pages), how to go about generating a dropdown menu of integer values 1 to number-of-pages? Without some kind of looping capability, I’m at a loss, but maybe I’m overlooking something.


In these instances I tend to create a table with just numbers (uploaded from a spreadsheet) and then do a search contsrained on items until = the highest page.

1 Like

Hey, that’s clever, @NigelG. I hadn’t thought of that. Thanks for the tip!

This topic was automatically closed after 70 days. New replies are no longer allowed.