# Order Subviews by Field

**URL:** <https://speciforum.org/t/order-subviews-by-field/371>\
**Category:** Configuration & Installation\
**Tags:** Specify-7, Members-only\
**Created:** [April 5, 2022, 2:25pm UTC](https://speciforum.org/t/order-subviews-by-field/371 "2022-04-05T14:25:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grant](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/grant/32/4255_2.png) [@Grant](https://speciforum.org/u/Grant)\
**Post date:** [April 5, 2022, 2:25pm UTC](https://speciforum.org/t/order-subviews-by-field/371/1 "2022-04-05T14:25:52Z")

</div>

Specify 7.7 features the ability to order a subview by any field!

In the form’s XML, you can:

Replace

```xml
<cell
  type="subview"
  viewname="CollectionObjectSub"
  id="11"
  colspan="9"
  rows="3"
  name="collectionObjects"
  initialize="addsearch=true"
/>

```

with

```xml
<cell
  type="subview"
  viewname="CollectionObjectSub"
  id="11"
  colspan="9"
  rows="3"
  name="collectionObjects"
  initialize="addsearch=true;sortfield=someField"
/>

```

where “someField” is the field you want to sort by.

This would sort in the Ascending direction. To do Descending sort, prepend field name with a dash (e.i “-timestampcreated”)

This also works for forms in grid view (i.e. formtable)

---

<div class="post-metadata">

**Author:** ![Elizabeth](https://avatars.discourse-cdn.com/v4/letter/e/34f0e0/32.png) [@Elizabeth](https://speciforum.org/u/Elizabeth)\
**Post date:** [January 13, 2026, 6:05pm UTC](https://speciforum.org/t/order-subviews-by-field/371/2 "2026-01-13T18:05:03Z")

</div>


