Forum Academy Marketplace Showcase Pricing Features

Display items added last in a text list

I am trying to display only the last items of text list. I tried using sort but its displaying the alphabetical sort instead.

Does anyone know the most performant way of displaying last items ?

Sort by “created on” descending “no”

1 Like

Thanks Carlos. Doesn’t seem to be an option. Am I missing something?

Bubble Editor 2021-06-04 13-54-12

I should have mentioned it’s a state (text list) on page

:sorted

Carlos, I am not sure what do you mean.

Add sorted? I already did that(see the screenshot above). Doesn’t seem to have an option of created by date as its a text list on page’s state.

If you meant something else, can you please elaborate.

Tried adding it. Doesn’t work :upside_down_face:. Same issue.

Any other solution besides relying on sort.

Because your list is a list of texts, the only option you have for sorting is alphabetical (either ascending or descending).

But if you don’t apply any sort, then by default the list should remain in the order that items were added to it (i.e. the first one at the top, the last one at the bottom).

So if you want to show that last item added to the list just use :last item (there’s no need to apply any sort to it).

3 Likes

Thanks @adamhholmes. I agree. I am trying to show last 5 items. What expression can I use?

@SumitC

Instead of a states list consider using a repeating group which adds more power (sorting, conditions, etc)

Just place it in a popup that way it does not interfere with the rest of the page. Name it whatever your want … “data - things” so that it is easier to find in expressions and you do not get “thrown off” by seeing the word “repeating group”. It will house your list and enable more options to manage it.

To display the last 5 items in a list you can use :items from# (the total number of items in the list - 4)

You’ll need to set that value somewhere first (i.e. in a custom state) as you can’t set it directly in a text box, and make sure you update it whenever the list changes or is added to.

1 Like

Makes sense. Let me try it.