ServiceNow - 获取所有记录 [英] ServiceNow - Getting all records

查看:1541
本文介绍了ServiceNow - 获取所有记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ServiceNow 中,我可以获得在 SOAP 请求中最多只能包含 250 个记录。如何获取 全部 记录?

  Web参考Url = https ://*****.service-now.com/rm_story.do?WSDL 

代码:

  var url =https://*****.service-now.com/rm_story.do?SOAP ; 
var userName = *****;
var password = *****;

var proxy = new ServiceNow_rm_story
{
Url = url,
Credentials = new NetworkCredential(userName,password)
};

try
{
var objRecord = new Namespace.WebReference.getRecords
{
// filters ..
};

var recordResults = proxy.getRecords(objRecord);
}
catch(例外)
{

}

recordResults 中,我只获得 250 条记录。如何获取所有记录?

解决方案


获取ServiceNow记录Powershell - 超过250个 p>

请注意,返回大量记录可能会影响响应的性能,并且使用偏移量批量处理查询可能更有效(即,获取1-100,然后101-200,...)。这可以通过使用排序顺序和偏移来实现。 ServiceNow REST Table API实际上返回来自Get请求的链接头,提供第一,下一和最后一组记录的链接,使得容易知道URL查询下一批记录。



请参阅: http://wiki.servicenow.com/index。 php?title = Table_API#方法
,并在响应头下查看。


In ServiceNow, I am able to get only a maximum of 250 records in a SOAP request. How to get all the records?

Web Reference Url = https://*****.service-now.com/rm_story.do?WSDL

Code:

            var url = "https://*****.service-now.com/rm_story.do?SOAP";
            var userName = *****;
            var password = *****;

            var proxy = new ServiceNow_rm_story
            {
                Url = url,
                Credentials = new NetworkCredential(userName, password)
            };

            try
            {
                var objRecord = new Namespace.WebReference.getRecords
                {
                    // filters..
                };

                var recordResults = proxy.getRecords(objRecord);
            }
            catch (Exception ex)
            {

            }

In recordResults, I am getting only 250 records. How to get all the records ?

解决方案

Also see this stack overflow answer which provides info. Get ServiceNow Records Powershell - More than 250

Note that returning a large number of records can affect performance of the response and it may be more efficient to process your query in batches using offsets (i.e., get 1-100, then 101-200, ...). This can be achieved by using a sort order and offset. The ServiceNow REST Table API actually returns link headers from Get requests providing you links for the first, next and last set of records making it easy to know the url to query the next batch of records.

See: http://wiki.servicenow.com/index.php?title=Table_API#Methods and look under 'Response Header'.

这篇关于ServiceNow - 获取所有记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆