Multiple Custom Sorting Considerations

I am in the process of trying to design my data type and am trying to wrap my head around how this is going to work. The ultimate goal is sorting a repeating group for registering lockers.

A little bit about our facility to flesh out the reason for needing to do things the way I’m going to talk about… we have four warehouses under one roof (each area is recognized separately). So our lockers are numbered a bit differently to allow people to understand where they are located.

An example locker number would be 1B089. First character is the warehouse number. Second character is a descriptor of what’s around the lockers. In this case, this would be a break room. The last three characters are the actual number of the locker. The locker would reside in what we would call ‘1B section.’

My objective is to group sections together in the order in which they appear in a line across a given area. What I mean by ‘in a line’ is that as you walk down a walkway, one would pass by 1R section, then 1H section, 1I section, and then 1S section. If someone is scrolling down the list, I would like them in that order so they know approximately where that locker is located.

To be clear, this is how it should appear in the repeating group:

1R000
1R001
1R002
1R003
1H000
1H001
1H002
1H003
1I000
1I001
1I002
1I003
1S000
1S001
1S002
1S003

My thought for addressing this is creating a field that contains a list of locker numbers, a Section field to group that list of lockers, and then an Order field so that I can sort by Order (numerical). Problem with a list of lockers is that I can’t assign a status to each one because it’s a list and not a single text item. Status would be like In Use, Cleaning, or Damaged. Not to mention I’m not really sure how to make each item in the list show up on individual lines in the repeating group.

I would certainly welcome any thoughts on how to best tackle this data type design. Am I on the right path here?

Hi there, @bryan.beneker… what I am about to suggest might not be the best way to go, but after thinking about this one for a bit, I can’t see why it wouldn’t work.

So, given that you have to create all of these lockers as things in a data type, you have control over the order in which they are created. That being said, I’m not sure (but I could easily be missing something) you need to do anything special to order them because you can simply create the things in the order you want them to be displayed.

If it was me, I might go with a Locker data type that looks like this…

It’s probably not necessary to break the parts of the number into those separate fields, but it could be useful for some reason, so I would probably consider it. Also, it wouldn’t be hard to put the fields together to display the full locker number, so again, I’m not sure I see a downside to breaking it up.

Anyway, back the original thought… the order can simply be determined by how you create the lockers in the data type. So, if you need all of the 1R’s to be displayed before the 1H’s, create them in that order in the data type, and you will get the ordering in the app “for free.” Also, by using the data type as I have suggested, you have a status field (which I tied to an option set) where you can set the status of each locker, and you can use the status to do interesting things such as filtering out damaged lockers, perhaps.

So, that’s what I’ve got, and I hope this response is helpful, even if it’s just food for thought.

Best…
Mike

Hi @mikeloc ! I’m sorry for the late response. Internet was down for 7 hours in our area yesterday and didn’t get your message until now.

I have considered this approach as well and it would be perfect if locker locations were guaranteed to never change. The thing that concerns me about this approach is that if at some point in the future they decide to add lockers to a section for some reason, create a new section between other sections, or move an entire section somewhere else, then it’s going to be a very drawn out process to update things. Not to mention it disturbs the integrity of the data (Take out what I need to and in the process of putting it back in, I forget to include updated data which then creates discrepancies with people).

On the flip side, I don’t think the chances of them moving lockers around is strong. BUT with my luck, they would do it at some point. We have a section that’s barely used, and I could totally see them moving those lockers up into another building that has higher traffic at some point. That makes me as nervous as a long tailed cat in a room full of rocking chairs…

Thank you for the consideration and conversation. If you have any other ideas, I would certainly welcome them. Today I’m going to try to learn about working with lists and see if it is possible to list them in each row of a repeating group and what other options are available to me. I may end up taking your direction, but I want to know what else is out there first.

It may be a moot point because I have included filters for my repeating group for users to find what they’re looking for. See below.

Yeah, I can understand being worried about having to reorder things. I had thought about that a bit, but I wondered if it would even be possible for things like lockers to move around. Given your additional thoughts, I would probably still go with what I proposed, and I might add an order field to give me some flexibility if the order needs to change.

1 Like