Custom Sort

I need a bit of help with the following that I think I might be needing to integrate sort or orderedby expressions but I am not sure.

My Data:

Global Status Table
image

Product Table
-Global Status is Ref to the Global Status Table

image

Product View
-Global Status is

image

Questions:

I only have the option to sort Global Status by Ascending or Decending order. How do I sort in either:

  1. Custom selecting / sorting the data records in Global Status column (Similar to custom sort in excel)
    or
  2. Sort by the numercial order added in Global Status Order without needing to unnessasary pull the data into the Product table via a Virtual Column and sort by that instead.

Hi @Michael_Pinto!

I’m not sure if this is what you need but I wonder if simply using a table view with headers in AppSheet might not give you the capacity you are looking for. If you have headers in an AppSheet table, the user can choose the header to tap on to order the records by that column, and then tap again on the same column to reverse the order. Please see “How do I get headers to show?” in the following:

Hi Kirk

I familiar with sorting capabilities on the header and unfortunately that does not solve my issue. Sorting it this way still means that the data is sorted alphabetically, where as I needed it to be custom sorted to my specifications to help facilitate my users see relevant data 1st.

To give you an example of what I see in my app vs what I want.

Current sort (Alphabetical)

Requested sort
I would like to rather sort as follows:

  1. Commercial
  2. Commercial Introduction
  3. Commercial Delete

I see. Thank you for explaining that. I’m afraid I don’t have enough knowledge to help. I hope someone else can. Perhaps @Aleksi, @Steve, or @LeventK. :slight_smile:

@Michael_Pinto In general, Sorting can only be done with the data available to the sort function. So, if you cannot get the data sorted in the order you wish with the data you have, you will have to introduce data that allows the sort order you wish.

In your case, I would recommend assigning a Code value to the Global Status’s. In other words, a separate hidden column that has a value that you solely use for sorting.

I also recommend using values such as 10, 20, 30, etc rather than 1,2,3. If in the future you decide to add status’s that go between existing ones, then you only need to choose a sorting number value in between like 5, 15, 25, etc.

1 Like

It appears you want the groupings sorted non-alphabetically in a table view. The only way to accomplish what you want is to prefix the group names with a number (or other prefix) that will sort as you want. For instance, make the group names literally 1. Commercial, 2. Commercial Introduction, and 3. Commercial Delete, with the 1., 2., and 3. actually in the names.

1 Like

I was afraid of that, but thank you for the support

1 Like

Yes, @Steve is correct. I didn’t catch that you wanted the Groupings themselves sorted. Sorry about the confusion.

I have played with AppSheet trying to see if I can get Group Sorting accomplished some other way but there just isn’t. Many others have seen the same problem. I have opened the Feature Request below for it. It just needs attention from other developers to get it prioritized.

FYI, I focused on Ref columns in the Feature Request because if you are applying a custom sort for Group headings, you will likely want to do something like what i described above. The best way to manage that is in its own utility table and then Ref to it - not within your data tables.

1 Like