I’m fairly new to AppGyver. I’m working on a book database, and I’m trying to see If I can repeat a component e.g a button up to certain number of times (defined by a App level variable).
In my case I have number of pages of the book defined in an app level variable e.g 15 pages, and I would like to create X buttons on the page, so that users can click on a page and go page specific details.
Thank you in advance.
Hi, welcome to the community!
If you have a number of pages set in an app variable
appVars.pages = 15 and a data resource containing all the pages as objects
BookPages, you can take e.g. the first 15 items from the list with
SLICE(data.BookPages, 0, appVars.pages - 1) (see documentation).
Then you can repeat the buttons with that list to display individual items, this tutorial is pretty good for how to do that part.
Thanks for the response Mari.
In my case the pages are not individually listed in the database table, I just have the total number of pages and I needed to generate buttons for that.
Anyway I got it done with the help of following tutorial…