Sort by thing's name

Hello, there I am trying to sort information in my RG based on a Unit’s Status.

Status is a text value that is set statically and is not dynamic (eg; each time I change in the DB I type the entry into the workflow)

I want to have a sorting system where status’ will display in order of…

Available
Committed
Mealbreak
En Route
On Scene
Transporting

Hi there, @cliffwoodjames… given that Status is static text, I can’t think of a way to sort it in the order you are showing. If the statuses were defined as an option set (which I would almost certainly have done), then sorting them as you have described would be easily doable by putting the options in the set in the defined order or by adding an attribute to the set that defines the sort order. Is there any particular reason you are using static text?

Best…
Mike

2 Likes

If you use an option set for this you can set an ‘Order’ attribute to control the order - although actually option sets will, by default, display in the order they appear in the data tab of your app (and you can change that in the data tab) so depending on the complexity you need you may not even need an ‘Order’ attribute.

2 Likes

I’m still a noob to option sets to be honest and I’m not really fully aware of the potential they offer. I will look into converting thsi static text onto option sets now, maybe are you able to provide some reference documents/videos for option sets that are easy to understand?

Than you,

Jmes

1 Like

Ah, once you start using option sets, you’ll be hooked for sure. :slight_smile:

https://manual.bubble.io/help-guides/structuring-an-application/option-sets

1 Like

Thank you!! :slightly_smiling_face:

1 Like

Hi - just running through this and I seem to be having difficulty getting them to display in the correct order. When I update the status no changes take place? I can’t sort by Status in the repeating group though.

Aw, crap… I forgot you can’t sort a repeating group by an option set… sorry about that. That being said, I still stand by the fact that option sets are awesome. :slight_smile:

I’m sure there are workarounds, but I’m also sure they are all hacky as hell. When I am doing something like what you have described, I almost always go with the ability to filter the repeating group as opposed to sort it because I assume if a user is sorting by something like status, they want to see all of the things that have a particular status. In that case, I think a filter is just as good (if not better) than a sort, and then an option set works like a charm.

1 Like

Yeah I’ve defaulted back to using static text but with an additional field of StatusNumber and sorting by that which is working - sorted now either way and at least I’ve learnt some stuff about option sets!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.