New External Sorting doesn't function properly

Options

Hi there,


The new simple mode for External sorting is not functioning correctly


https://docs.xano.com/working-with-data/functions/database-requests/query-all-records/external-query-manipulation/external-sorting


Also just an FYI, the example JSON code you have provided in the docs isn't a valid JSON.


The structure of the JSON looks the same on both old and new, and when I test it on the classic version it functions correctly, but it doesn't on the simple version.

Best Answer

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    edited February 2023 Answer ✓
    Options

    Got it! I think the documentation is just wrong in this case. The correct shape (or at least what works for me) is:

    [{"sortBy": "fieldName", "orderBy":"desc"}]


    Note that the wrapping object and "sort" key are absent from the above!

    (Click-through in Xano: create array, then push a blank object, on which one sets the sortBypath to "fieldName" and the orderBy path to "desc")


    This kind of tricky business between-the-lines of the docs comes up a lot in our daily State Change Pro office hours.

Answers