Dynamic Number of Rows in Repeating Group

I am trying to create a page where the user can select a number (1-10) from a drop down. Depending on the number they select, I want to show that many sections/rows in a repeating group (or something similar). So for example, if the user selects “2”, the RG should only show 2 rows. I know I could probably do this by storing the “number of rows” in the database, but I was hoping to do this with states. Any advice on if this can be done or how to go about something like this?

In your rg data source, use :items until state#.

4 Likes

@yourmom

Custom state on the page of type number. Let’s call it rowsnumber.

The dropdown can have … say … 10 static numbers. Use the event “when inputs value changes” (this dropdown would be the input) set its value to the rownsnumber page custom state.

In the rg set 10 conditions when the page custom state rowsnumber is 1 … to 10 … to have the data source be of search things :items until # … and set that number to be the dropdown value.

That should do the trick :grinning:

1 Like

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