- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2024 11:12 PM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2024 12:38 AM - edited ‎07-31-2024 01:35 AM
Hi @KM SN ,
I think you're looking for the X-Total-Count, which is part of the Header, not the body...
Probably something like : var count = response.getHeader('X-Total-Count');
Hope this helps,
Hayo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2024 10:15 PM
Hi @KM SN ,
It is the total number of records in the full collection.
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2024 12:38 AM - edited ‎07-31-2024 01:35 AM
Hi @KM SN ,
I think you're looking for the X-Total-Count, which is part of the Header, not the body...
Probably something like : var count = response.getHeader('X-Total-Count');
Hope this helps,
Hayo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2024 06:27 AM
I am not getting the data and count its showing as 0 might be as i am not getting the data? what could be reason that i am not getting the data?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2024 07:03 AM
Hi @KM SN ,
That might be of an authentication error or incorrect endpoint or ...
Can you log some more data?
Statuscode (should be 200) :
If everything is fine, comment out your queryparameter and add e.g. sysparm_limit=10, to make sure it's not the query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2024 09:47 PM
Hey @Hayo Lubbers
Thanks for your time I am getting what I am looking for.
May i know what X-Total-Count is exactly.