Skip to content

REST_CountRecords

Julio Carneiro edited this page Mar 14, 2020 · 8 revisions

The REST_CountRecords HTTP Request is used to calculate the number of records in a 4D Database Table that matches a given query string.

The POST request payload must include the following arguments/attributes:

  • TableName: name of the table to get records from
  • QueryString: a JS44D query string (see documentation here)
  • FilterOptions: Record filter is also a JS44D query string, applied to the query results to further filter down the record selection to return

The Table name must be a valid table in the host database structure.

The JS44D QueryString is used to select the record count to return. To that selection the FilterOptions, if non empty, will be applied to eventually further reduce the selected record count.

Both QueryString and FilterOptions are documented in The JS44D Query String page.

The REST_CountRecords response is a JSON object with the following attributes:

  • valid: true or false to indicate if the parameters given are valid or not
  • selected: the total number of records selected, after applying the QueryString and the FilterOptions
  • message: the error message returned by the request, in case 'valid' is false.

Sample Request

Here is a sample request:

https://gyazo.com/e9031ef12237b4328a0ff43e0adc7a97

And the response to the request above would look something like:

https://gyazo.com/96f564d2cf0e3a64dcbd17c7e47dc988

Clone this wiki locally