Query option $apply

Use the $apply query option to transform returned records in the response. The $apply query option allows you to combine aggregate (sum, min, max, average, countdistinct) and groupby transformation functions together.

Component Description

HTTP method

GET

URL

https://host/fmi/odata/version/database-name/table-name?$apply=functions

host – FileMaker Cloud or FileMaker Server host name

version – the OData version, always v4

database-name – the name of the hosted database

table-name - the name of the table or FileMaker Table ID (FMTID)

functions - the functions used to transform the returned data

Examples:

  • /fmi/odata/v4/Inventory/Purchase?$apply=aggregate(Total add 1 with sum as t,Total with average as a)

  • /fmi/odata/v4/Inventory/Purchase?$apply=groupby(("Product ID", "Customer ID"))

  • /fmi/odata/v4/Inventory/Purchase?$apply=groupby(("Product ID", "Customer ID"),aggregate(Total add 1 with sum as t,Total with average as a))