Is there anyway to build a dynamic list ordered numerically?

Hi, anyone can figure out how to build a dynamic list ordered numerically?

1. List item one
2. List item two
3. List item…

Thanks in advance

The easiest way to do this is to ensure the items have a number field to serve as a unique ID. Then when displaying the items in a list, put some magic text that displays a count of the number of records where the number field is greater than the current record. That count serves as the list’s item number - that way when you add new items, the list numbers change accordingly.

EDIT: Sorry it should be where number of records is less than current record if you want them sorted from 1 to infinity.

1 Like

thank you for your reply @pford!

this solution wouldn’t work in the case where you are not only adding items to the list, but you can vote items and therefore are changing position depending on the number of votes, right?

Actually yes this can work like that. But all you would need is an update action to update a number field in the record called “number of votes” and then sort the list by that. Lists can only be sorted by one property at a time. If you need to provide multiple sort options for users, you’ll need to create multiple lists controlled by visibility.

1 Like

omg, lot of things to do here for one of the simplest elements of html :see_no_evil:

But thanks for the answers, the important thing is that it seems that it can be done (although I have not yet understood very well how) but I will investigate it!

Thank you very much.

i’m lost here, what does it mean? It’s a formula? but if each record has a unique ID (not necessary consecutive, in case for example you delete a record) how to do that?

do you have any live example of this?

Thanks in advance!

Yes I will whip up an example app for you.

1 Like

looking forward to the example @pfordmedia :heart_eyes_cat: :pray:

Here’s a clone that you can try out and copy if you like. Be sure to look at the list number’s setup so you can see the magic sauce in that count filter. Ordered List Example

1 Like

Amazing @pford, thank you so much!!!

Sorry @pford, I have a doubt.

What happens when you want to sort by votes?

The problem is that N items can have the same number votes, so they have the same number in the list.

It’s a different scenario when you have unique IDs.

Any solution for this? Thank u in advance!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.