Param in api to check the table - has more rows ?

Adithya Khurana
Tera Contributor

Is there any params available in api call to check whether that table has more rows ? 
For instance,
Setting sysparm_offset - 1 & sysparm_limit - 10 will retrive the 10 records from the table. 
(At this point i am not aware whether that table has more rows or not ) 

1 ACCEPTED SOLUTION

Sohail Khilji
Kilo Patron
Kilo Patron

Dear @Adithya Khurana 

 

In the response, you can access the sysparm_total_count value to determine the total number of records in the table. If the sysparm_total_count is greater than the sum of the offset and limit, you can conclude that there are more rows available.

 

ex:

GET /api/now/table/<table_name>?sysparm_offset=0&sysparm_limit=10&sysparm_total_count=true


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

View solution in original post

4 REPLIES 4

Sai Kumar B
Mega Sage
Mega Sage

@Adithya Khurana 

There's no direct parameter to check more rows, May i know your full requirement?

 

Adithya Khurana
Tera Contributor

Thanks !!! I need to fetch incident data's in batches and will be writing for further reports and etc. So instead of checking for empty resultJson was looking for direct parameters.

If no direct Param , will do the empty check on retrieved result.  Thanks again!!! (Or if there any other alternate way kindly share)

what you have mention is connect , you can use empty check on retrieved result.


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Sohail Khilji
Kilo Patron
Kilo Patron

Dear @Adithya Khurana 

 

In the response, you can access the sysparm_total_count value to determine the total number of records in the table. If the sysparm_total_count is greater than the sum of the offset and limit, you can conclude that there are more rows available.

 

ex:

GET /api/now/table/<table_name>?sysparm_offset=0&sysparm_limit=10&sysparm_total_count=true


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect