[TIP] 'Show more' link and hide when reached end

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.

1

Add a repeating group to the page and refer the data source to the custom state.

2

Add a text or button saying “Show more” underneath the RG and update it’s workflow too trigger the custom state.

3

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.

4

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).

a

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).

b

4 Likes

That’s genius! great job. thanks for sharing.

Welcome!

Great solution here! Thanks!

Additional condition if there is one (or more dropdowns)?

Is there a way how to recognize that RG “came” to the end?

Another way is to copy all the “Searching conditions” here to hind the “show more” button, which could be ok, but if there is another way around it? Thanks!

Additional condition if there is one (or more dropdowns)?

How do you mean?

Is there a way how to recognize that RG “came” to the end?

Yes, see the section in the example above called ’ How to hide the ‘Show more’ link’. Basically when the RG’s list of results is equal or more than the total entries in the database we know we are at the end and so we can do/show something.