I am not getting the either incident list or count of incidents from REST message?

KM SN
Tera Expert

when I am trying to insert a incident record in source instance it should compare in target instance incident table with same caller id incidents and if the count is more than 5 allow the creation of incident else abort the action.

but I am not getting the count and list of incidents in the body when try to see them in the log.


I-2.pngI-3.png
I-1.png

I-3.png

2 ACCEPTED SOLUTIONS

Hayo Lubbers
Kilo Sage

Hi @KM SN ,

 

I think you're looking for the X-Total-Count, which is part of the Header, not the body...

https://docs.servicenow.com/bundle/washingtondc-api-reference/page/integrate/inbound-rest/concept/c_...

 

Probably something like : var count = response.getHeader('X-Total-Count');

HayoLubbers_0-1722414900882.png

 

 

Hope this helps,

Hayo

View solution in original post

Hi @KM SN ,

 

It is  the total number of records in the full collection.

X-Total-Count 

 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

View solution in original post

6 REPLIES 6

Hi @KM SN ,

 

It is  the total number of records in the full collection.

X-Total-Count 

 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

Hi @KM SN ,

 

I see the SN_Learn has already answered the question.

For all other statuscodes, headers and information in the response, please check out the link:

https://docs.servicenow.com/bundle/washingtondc-api-reference/page/integrate/inbound-rest/concept/c_...