Hi Bubblers,
I found a nice way to show/hide a “show more link” on a repeating group and thought I’d share!
The results of this tutorial will look like this (press play because it’s set on a loop otherwise).
https://www.loom.com/share/fb9d27107d644bbe98d7ff7d75407216
Create the show more functionality
Create a custom state on the page.
Add a repeating group to the page and refer the data source to the custom state.
Add a text or button saying “Show more” underneath the RG and update it’s workflow too trigger the custom state.
How to hide the ‘Show more’ link
It can be confusing for your users if the ‘Show more’ link remains visible even when there are no more results to show, So, to fix this we can hide it when the user has expanded all their available results.
Add a conditional to hide the ‘Show more’ link when the RG’s list of results is equal or more than the total entries in the database for that Thing.
Here’s how it works
Since I have set to only show 3 ‘expenses’ results in the RG, this means if there are 1, 2 or 3 results the conditional is matched, ie. list of results is equal or the total entries in the database. But, when we hit 4+ ‘expenses’ then the RG will be showing fewer results to the total entries in the database, thus the ‘Show more’ link reappears again!
How to add ‘Show less’ button.
Once a user has expanded all their results they may want to show less (or close them). Just add the Text ‘Show less’ and add a conditional to only show when the list of results is equal or the total entries in the database (same conditional as earlier).
The workflow for the Text ‘Show less’ now just resets the custom state to display ‘3’ (or how ever many you want to set as default).