# Custom Sort

**URL:** https://community.glideapps.com/t/custom-sort/11320
**Category:** Ask for Help
**Created:** [June 23, 2020, 1:07pm UTC](https://community.glideapps.com/t/custom-sort/11320 "2020-06-23T13:07:42Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Shannon\_Joseph](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shannon_joseph/32/7689_2.png) [@Shannon\_Joseph](https://community.glideapps.com/u/Shannon_Joseph)
#### Post date: [June 23, 2020, 1:07pm UTC](https://community.glideapps.com/t/custom-sort/11320/1 "2020-06-23T13:07:43Z")

</div>

I have 4 menu categories that I want to show sorted in the following order. I have tried to sort by a number of options, but nothing works.

1. Appetizer/Starter
2. Entree,Sides
3. Drinks & Beverage
4. Deserts/Sweets

How and where would I set up a custom sort to make sure it shows up in the above order?

---

<div class="post-metadata">

### Author: ![sardamit](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sardamit/32/263_2.png) [@sardamit](https://community.glideapps.com/u/sardamit)
#### Post date: [June 23, 2020, 1:12pm UTC](https://community.glideapps.com/t/custom-sort/11320/2 "2020-06-23T13:12:22Z")

</div>

Create a helper column with these numbers and sort using this column in the ascending order.

---

<div class="post-metadata">

### Author: ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)
#### Post date: [June 23, 2020, 1:12pm UTC](https://community.glideapps.com/t/custom-sort/11320/3 "2020-06-23T13:12:33Z")

</div>

Create a second column called Sort and enter 1-4 respectively.

---

<div class="post-metadata">

### Author: ![Shannon\_Joseph](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shannon_joseph/32/7689_2.png) [@Shannon\_Joseph](https://community.glideapps.com/u/Shannon_Joseph)
#### Post date: [June 23, 2020, 1:17pm UTC](https://community.glideapps.com/t/custom-sort/11320/4 "2020-06-23T13:17:39Z")

</div>

This is an inline relation list, so where would I add the column?

---

<div class="post-metadata">

### Author: ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)
#### Post date: [June 23, 2020, 1:19pm UTC](https://community.glideapps.com/t/custom-sort/11320/5 "2020-06-23T13:19:03Z")

</div>

In the sheet containing those 4 categories.

---

<div class="post-metadata">

### Author: ![Shannon\_Joseph](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shannon_joseph/32/7689_2.png) [@Shannon\_Joseph](https://community.glideapps.com/u/Shannon_Joseph)
#### Post date: [June 23, 2020, 1:21pm UTC](https://community.glideapps.com/t/custom-sort/11320/6 "2020-06-23T13:21:21Z")

</div>

I did it there, but I column does not show in the sort options.

---

<div class="post-metadata">

### Author: ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)
#### Post date: [June 23, 2020, 1:22pm UTC](https://community.glideapps.com/t/custom-sort/11320/7 "2020-06-23T13:22:52Z")

</div>

Screenshots would help 🙃

---

<div class="post-metadata">

### Author: ![Shannon\_Joseph](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shannon_joseph/32/7689_2.png) [@Shannon\_Joseph](https://community.glideapps.com/u/Shannon_Joseph)
#### Post date: [June 23, 2020, 1:25pm UTC](https://community.glideapps.com/t/custom-sort/11320/8 "2020-06-23T13:25:46Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/b/b7b19a939e64ec7544fd0a4077bf3b0809004788.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/f/fb54c81a9b8672a9a39024d61a478a49f536a2a6.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/a/a23d6cc47fd760dcb3b218a2f62e720fb45be66e.png)

---

<div class="post-metadata">

### Author: ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)
#### Post date: [June 23, 2020, 1:28pm UTC](https://community.glideapps.com/t/custom-sort/11320/9 "2020-06-23T13:28:02Z")

</div>

In the first image you have a “New Column” that’s the relation. Is this the same relation you are trying to sort and the same relation labeled “Menu Relations” in the second image?

---

<div class="post-metadata">

### Author: ![Shannon\_Joseph](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shannon_joseph/32/7689_2.png) [@Shannon\_Joseph](https://community.glideapps.com/u/Shannon_Joseph)
#### Post date: [June 23, 2020, 1:28pm UTC](https://community.glideapps.com/t/custom-sort/11320/10 "2020-06-23T13:28:52Z")

</div>

Yes.

---

<div class="post-metadata">

### Author: ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)
#### Post date: [June 23, 2020, 1:32pm UTC](https://community.glideapps.com/t/custom-sort/11320/11 "2020-06-23T13:32:48Z")

</div>

You’ll need to do one of two things, then:

1. Do an inline list of the “Menu Category” sheet, not the relation  
OR
2. If you want to use the relation, you’ll need to insert the sort numbers (via formula) dynamically in the menu items sheet ("If category is appetizer then 1…etc.)

---

<div class="post-metadata">

### Author: ![Shannon\_Joseph](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shannon_joseph/32/7689_2.png) [@Shannon\_Joseph](https://community.glideapps.com/u/Shannon_Joseph)
#### Post date: [June 23, 2020, 1:39pm UTC](https://community.glideapps.com/t/custom-sort/11320/12 "2020-06-23T13:39:57Z")

</div>

Here is the menu sheet, so which sheet should I add the formula?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/f/f1c908505093790cd845f0701885ccdb1b0cc81a.png)

---

<div class="post-metadata">

### Author: ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)
#### Post date: [June 23, 2020, 1:42pm UTC](https://community.glideapps.com/t/custom-sort/11320/13 "2020-06-23T13:42:59Z")

</div>

Depends. Are you organizing just the 5 categories in that order or are you organizing all the menu items in that order?

---

<div class="post-metadata">

### Author: ![Shannon\_Joseph](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shannon_joseph/32/7689_2.png) [@Shannon\_Joseph](https://community.glideapps.com/u/Shannon_Joseph)
#### Post date: [June 23, 2020, 1:45pm UTC](https://community.glideapps.com/t/custom-sort/11320/14 "2020-06-23T13:45:21Z")

</div>

I want each truck ment to be categorized in this order, so no matter which truck the user clicks on, the menu will sort in this order.

---

<div class="post-metadata">

### Author: ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)
#### Post date: [June 23, 2020, 1:48pm UTC](https://community.glideapps.com/t/custom-sort/11320/15 "2020-06-23T13:48:39Z")

</div>

To sort the menu _items_ in this order, you’ll need to add the if-then-else column to the menu sheet (last photo you shared).

---

<div class="post-metadata">

### Author: ![Rik\_Ahlberg](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rik_ahlberg/32/1003_2.png) [@Rik\_Ahlberg](https://community.glideapps.com/u/Rik_Ahlberg)
#### Post date: [June 23, 2020, 2:44pm UTC](https://community.glideapps.com/t/custom-sort/11320/16 "2020-06-23T14:44:15Z")

</div>

The Sort filter also has a “Sheet order” option - are you seeing that? It shows up at the top of the list so you have to scroll up. I use it in a lot of my inline lists where the sequence I want isn’t alphabetical (see the list that starts with “Indoor seating” in the screenshot):

 ![Screenshot 2020-06-23 10.42.43](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/3/345c5c8aa6d6956c18ffbd427e54cd83a0fa1a63.jpeg)

---

<div class="post-metadata">

### Author: ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)
#### Post date: [June 23, 2020, 3:04pm UTC](https://community.glideapps.com/t/custom-sort/11320/17 "2020-06-23T15:04:20Z")

</div>

Right…problem is, as I’m guessing, is that the Menu Items are submitted via form entry and thus the app owner has no control over the sheet order. Having an if-then-else to assign a 1-5 number will solve this.

I do this with Dates, too. Sometimes I want to sort user-submitted posts by date, but I also want “pinned/featured” posts on the top. So, I create an if-then-else column called “Sort”. If I’m sorting by date with oldest on top, I do an “if Featured then -1 else date” if I want descending with newest on top then I do “if Featured then 99999 else date”.

Then I sort by “Sort”. Here’s the result:

 ![Screen Shot 2020-06-23 at 11.02.08 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/a/abd1eb417bb9ce72ed6089cdde9d203d9571c5fc.png)  
 ![Screen Shot 2020-06-23 at 11.02.28 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/a/a499fcbf8ce56ce9e5797b9d87b8ba614ba0e298.jpeg)

---

<div class="post-metadata">

### Author: ![Shannon\_Joseph](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shannon_joseph/32/7689_2.png) [@Shannon\_Joseph](https://community.glideapps.com/u/Shannon_Joseph)
#### Post date: [June 23, 2020, 3:16pm UTC](https://community.glideapps.com/t/custom-sort/11320/18 "2020-06-23T15:16:58Z")

</div>

Entry will be by a choice list (via another app using the same sheet) of the items mentioned previously, and no control over the sheet order.

I am still confused on what data to use for the if-then-else function.

---

<div class="post-metadata">

### Author: ![Shannon\_Joseph](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shannon_joseph/32/7689_2.png) [@Shannon\_Joseph](https://community.glideapps.com/u/Shannon_Joseph)
#### Post date: [June 23, 2020, 3:19pm UTC](https://community.glideapps.com/t/custom-sort/11320/19 "2020-06-23T15:19:30Z")

</div>

It seems I am getting limited optins for the if-then

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/3/3766102ee7d1a269ce9fdbd1aabf176ae018c6b0.png)

---

<div class="post-metadata">

### Author: ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)
#### Post date: [June 23, 2020, 3:21pm UTC](https://community.glideapps.com/t/custom-sort/11320/20 "2020-06-23T15:21:03Z")

</div>

Is your “Menu Category” an array column?

[Next page](https://community.glideapps.com/t/custom-sort/11320.md?page=2)
