Sorting records in Data API responses

Expert

Apply single and multi-field sort orders to Data API requests using the sort parameter.

What you'll learn

  • How to specify a sort order in a Data API request
  • How to sort by multiple fields with different sort orders
  • How to use "ascend" and "descend" as sort direction values

The FileMaker Data API supports sorting via a JSON array in the sort query parameter. You can sort by multiple fields, mix ascending and descending orders, and sort by portal fields — giving you full control over record order in the response.

Stuck is a valid status

Need a second brain on this one?

If this lesson just collided with your real schema, script stack, or deadline, book consulting and turn the confusion into a concrete plan.

Book consulting
1/3
1

Single-field sort

Pass a JSON-encoded sort array as the sort query parameter. Each object has a fieldName and sortOrder.

HTTP
GET /fmi/data/v1/databases/MyDB/layouts/Contacts/records
  ?sort=[{"fieldName":"LastName","sortOrder":"ascend"}]

Sign in to track your progress and pick up where you left off.

Sign in to FM Dojo