Problem: The Result Record Count parameter is not reflected when querying services from the REST endpoint


When querying a feature or map service from the REST endpoint on ArcGIS Server, it is possible to use Result Record Count (resultrecordcount) to obtain a number of query results. However, when the Result Record Count parameter is specified and Return Count Only is set to True, the query count does not reflect the value set in Result Record Count.


This is a known limitation.

Solution or Workaround

There are two ways to solve this issue:

  • Use a file geodatabase data or non-enterprise geodatabase data to publish the map service.
  • Create and publish a new query layer from the features. Follow the steps below:
  1. In ArcMap, open the Make Query Layer tool. Use the enterprise SDE connection as the database source.
  2. Use the following expression to query the features in one of the SDE feature classes.
    SELECT * FROM Roads
  3. Add the query layer to the map.
  4. Publish the query layer to ArcGIS Server.
  5. When querying from the REST endpoint with a resultRecordCount value, the value is reflected in the query count.

Related Information