Notifications

32 views

Symptoms

Error message 'sysparm_limit value must be a positive integer' is seen when making inbound REST API GET call with sysparm_limit=0

Release

London

Cause

sysparm_limit is used to specify maximum number of records to be returned in the response. Setting it to 0 is considered invalid and this causes the request to fail.  

Resolution

If you are trying to retrieve less than 10,000 rows you can just remove the sysparm_limit from the query.  
The system by default has a limit of 10,000. If the result is more than 10,000 the "x-total count" header in response contains the total number of records for the query. 
You can use this and make as many calls needed to get all the records. 

Note: The limit parameter defaults to 10,000 records. This limit can be set to any value. Be aware, however, that an unusually large value can impact system performance. 
X-Total-Count Total count of records returned by the query. 

The best practice to retrieve large number of records is by using pagination. You may follow the steps provided in KB0727636.

 

Article Information

Last Updated:2019-05-21 14:34:59
Published:2019-05-21