# Sort Precedence

**URL:** <https://community.nextw.com/t/sort-precedence/2011>\
**Category:** Nextworld Platform\
**Created:** [May 6, 2026, 2:26pm UTC](https://community.nextw.com/t/sort-precedence/2011 "2026-05-06T14:26:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bethany.k](https://sea1.discourse-cdn.com/flex001/user_avatar/community.nextw.com/bethany.k/32/111_2.png) [@bethany.k](https://community.nextw.com/u/bethany.k)\
**Post date:** [May 6, 2026, 2:26pm UTC](https://community.nextw.com/t/sort-precedence/2011/1 "2026-05-06T14:26:05Z")

</div>

What is the precedence in which the following sorts get applied and when do they get applied? I have a use-case where I have logic that is loading details in an HD–when debugging the logic block fetch with the sort (it a dynamic sort), and its not sorting the way I expected.

- Sort defined in a logic block
- Sort defined on application
- Sort defined on index field

---

<div class="post-metadata">

**Author:** ![brendan.b](https://sea1.discourse-cdn.com/flex001/user_avatar/community.nextw.com/brendan.b/32/269_2.png) [@brendan.b](https://community.nextw.com/u/brendan.b)\
**Post date:** [May 6, 2026, 2:34pm UTC](https://community.nextw.com/t/sort-precedence/2011/2 "2026-05-06T14:34:42Z")

</div>

The sort defined in the logic block is always used when present in a logic block fetch. If no sort is defined in the logic block, then it will fall back to the database’s sort preference. This _may_ align with the sort specified on the table index, but that is not guaranteed and should not be relied upon.

Similar fallback happens with an application: we will use the sort defined in the app or fall back to the database’s sort if none is defined.

Does this align with what you’re seeing?

---

<div class="post-metadata">

**Author:** ![bethany.k](https://sea1.discourse-cdn.com/flex001/user_avatar/community.nextw.com/bethany.k/32/111_2.png) [@bethany.k](https://community.nextw.com/u/bethany.k)\
**Post date:** [May 6, 2026, 2:37pm UTC](https://community.nextw.com/t/sort-precedence/2011/3 "2026-05-06T14:37:25Z")

</div>

Thank you, @brendan.b! It appears like it started out sorting as I expected, but then it looked like it stopped sorting. I will debug again now that you have confirmed this and see if something else is at play.
