How can we achieve pagination in a SOAP request?

Shaji_Kalidasan
Tera Guru

How can we overcome the default hard-limit of 250 records for a single SOAP request? If so, how can we achieve it using pagination or through other means? Please share an example of pagination using SOAP if applicable.

Here is the endpoint

https://example.service-now.com/u_custom_cmdb_ci_server.do?SOAP

Here is the payload

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<getRecords xmlns="http://www.service-now.com/u_custom_cmdb_ci_server">

</getRecords>
</Body>
</Envelope>

Note: I am using SoapUI to test this scenario

 

1 ACCEPTED SOLUTION

Hi Ankur,

We were able to overcome the hard-limit imposed by ServiceNow by using the following option

https://example.service-now.com/u_igar_cmdb_ci_server.do?SOAP

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<getRecords xmlns="http://www.service-now.com/u_igar_cmdb_ci_server">
<__limit>1000</__limit>
<__first_row>0</__first_row>
<__last_row>500</__last_row>
</getRecords>
</Body>
</Envelope>

This approach returned 500 records.

However, I am marking your suggestion to migrate to REST API as helpful.

Thank you.

Best Regards,
Shaji Kalidasan

View solution in original post

5 REPLIES 5

@Shaji

So you are setting the limit as 1000 and the offset as 500

Thanks for sharing

Please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader