data-api-builder
data-api-builder copied to clipboard
Return total number of records in response JSON
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
}