data-api-builder icon indicating copy to clipboard operation
data-api-builder copied to clipboard

Return total number of records in response JSON

Open die-baas opened this issue 9 months ago • 0 comments

To support pagination in infinite scrolling implementations, please add the total number of records in the record set in the response JSON, or include in the response header.

Example JSON returned for this API:

api/customer?%24first=2

{
    "value": [
      {
        "CustomerID": 8,
        "CustomerName": "Test customer 1",
        "CustomerEmail": "",
        "CustomerActive": 1
      },
      {
        "CustomerID": 90,
        "CustomerName": "Test customer 2",
        "CustomerEmail": "",
        "CustomerActive": 1
      }
    ],
    "nextLink": "api/customer?$first=2&$after=token....",
    **"totalrecords": 985** <-- add this
  }

die-baas avatar Apr 14 '25 15:04 die-baas