Closed Carles-Figuerola closed 7 years ago
Hello!
Using sysparm_limit
does limit the result, however, link headers are still present on all responses by default. Pysnow follows links automatically and chains in one result.
You can disable this (link headers) by passing {'sysparm_suppress_pagination_header': True} in default_payload
.
Does that work for you?
I'll create a limit()
method that does this automatically.
/Robert
Many thanks for the prompt response. That extra payload options does indeed stop the recurrence on the query, but as you say a limit()
or do_not_follow_links()
would be useful to not depend on servicenow's api options.
Thanks!
Hello,
Implemented in #23 , getting released in 0.3.2 (in a few days)
Thanks for reporting :)
Regards, Robert
Fixed.
You can now limit the number records returned from the SN API by passing limit
to get_all()
Docs: http://pysnow.readthedocs.io/en/latest/_modules/pysnow.html#Request.get_all
I am trying to get only a subset of a table, I saw that Client() has a default_payload and you can specify a sysparm_limit, but when I set it, when doing:
I get all the results, but paged through my sysparm_limit. I would prefer (or at least have the option to) to see only N results total.