# Inlist sort order

**URL:** <https://community.glideapps.com/t/inlist-sort-order/8081>\
**Category:** Ask for Help\
**Created:** [April 29, 2020, 12:36pm UTC](https://community.glideapps.com/t/inlist-sort-order/8081 "2020-04-29T12:36:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ugm](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ugm/32/530_2.png) [@ugm](https://community.glideapps.com/u/ugm)\
**Post date:** [April 29, 2020, 12:36pm UTC](https://community.glideapps.com/t/inlist-sort-order/8081/1 "2020-04-29T12:36:17Z")

</div>

I have two tables or sheets named “ **Workouts** ” and “ **Exercises** ”.

Each **Workout** can have 1 or more **Exercises**. In my case both these tables have rowids.

I add **Exercises** to **Workouts** by using choice components. The **Workout** table has fields named Ex 1, Ex 2, Ex 3, upto Ex 8 - ends up as an array field: Ex

When a Workout is selected, I show an inlist (using the Workout-\>Exercise 1:many relationship) along with other Workout detail.

I want the inlist component to maintain Ex 1, Ex 2, Ex 3… Ex 8 as the order of listing. If there is another way to do so let me know.

If the sort order for the inlist items is RowID (A-Z)

- Can I assume this will always be in the order of Exercise items i.e Ex 1, Ex 2, Ex 3 …upto Ex 8 ?

Grateful for a confirmation

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 29, 2020, 1:39pm UTC](https://community.glideapps.com/t/inlist-sort-order/8081/2 "2020-04-29T13:39:44Z")

</div>

If you sort the list by RowID alphabetically, then you are going to get random results because rowid is a random generated value.

Using the array for the relation will not guarantee the sort order of the list. The sort order of the list is determined only by the values in the exercise sheet.

If you are saying that an exercise could be either the 1st position or the 5th position and you want to respect the order they were entered in the workout, the I would create a relation for each ‘ex’ column and create an inline list for each relation.

---

<div class="post-metadata">

**Author:** ![ugm](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ugm/32/530_2.png) [@ugm](https://community.glideapps.com/u/ugm)\
**Post date:** [April 30, 2020, 1:40am UTC](https://community.glideapps.com/t/inlist-sort-order/8081/3 "2020-04-30T01:40:51Z")

</div>

> [@Jeff\_Hager](#):
>
> Using the array for the relation will not guarantee the sort order of the list. The sort order of the list is determined only by the values in the exercise sheet.

Thank You Jeff.  
Here is what I did as you suggested with a small twist.

Created 8 Workout-\>Exercise relations for each of EX1 to EX8 attributes. Even though EX1 in Workout has a 1:1 relation with Exercise, I had to indicate 1:many to enable INLIST component to see it.

Now I can maintain the desired order with a bit of extra work.
