'Show more' button for repeating groups

There are a lot of discussions around how to optimize loading of data on repeating groups, pagination etc.

It was be awesome if we could specific how many entries to load on a repeating group and have a button ‘Show More’ that loads more entries.

It would be the same effect as using extended vertical scrolling, except the trigger to load more entries is a user clicking on a button (vs automated when user scrolls to a part of the page). That way the user can free scroll up and down the page as if it was static without worrying about inadvertently triggering more data loading.

1 Like

It’s possible to do this. I haven’t done it in a while but you simple use the “items until” function in the repeating group. The number value of items shown can come from a custom state. Let’s say when the page is loaded, the number is set to 5. Your repeating group will show up to 5 items. Then when the “Show More” button underneath the repeating group is clicked, the custom state’s value will increase by 5. Now, there are 10 items being displayed.

Make sense?
Daniel

6 Likes

It makes sense. In this case, I would need to hide the ‘show more’ button when there are no more items to load. Not immediately clear to me how do this but I’ll play with it and report back.

Put the Show More button in a group that collapses when hidden. Now, add the following conditional to that group:

When Search for Item’s Count is equal to or less than the custom state’s number value, this group isn’t visible.

“Search for Item” is whatever you used for the repeating group but without the “items until” function.

2 Likes

Thanks. In my case the list is dynamic (changes based on conditions). So I had to create an intermediate hidden repeating group that holds the full search results. Then the visible group is a subset of that with items until # <custom_state_value>. Then I show the load more button when the shown results < the total results.

It turns out that neither approach works very well. In my case the load button condition takes too long to take effect (button hides/shows after a few seconds). I think its because the full search results have to load to determine whether the condition is true or not which is not efficient.

We have a way to load only a fixed number of results (RG fixed # of cells view). We need a workflow action that says “change number of results to X”.

This just helped me fix something in 1 minute after an hour of head scratching. Thank you!! @dbevan

1 Like

Thank you so much. This is really helpful!!

1 Like