REST API results and Servicenow View results not matching, seems that sysparm_display_value is limiting records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2019 10:04 PM
Hi,
I am trying to use the REST API to get all requested items of a particular catalog item, no other filter condition, however when I use the query like below, which contains sysparm_display_value=true, it seems to be limiting the records, sometimes if remove some of the sys_parm_fields, it is bringing all records. Basically i see different number of records when i use sysparm_display_value=true and sysparm_display_value=false or sysparm_display_value=all.
Is this a bug? or is there something missing in the query?
https://foo.service-now.com/api/now/table/sc_req_item?sysparm_query=cat_item%3Da812c491db022300994ca08a489619c2&sysparm_display_value=true&sysparm_fields=number%2Csys_created_on%2Cshort_description%2Cpriority%2Cstate%2Cassignment_group%2Cassigned_to%2Csys_created_on%2Csys_created_by2CState%2Cvariables.c3de14f6db922300994ca08a489619c2%2Cvariables.5a20603adb922300994ca08a489619ad%2Cvariables.9005147edb522300994ca08a48961902%2Cvariables.08579739db022300994ca08a489619e9%2Cvariables.27675b39db022300994ca08a4896191c%2Cvariables.4a165872db922300994ca08a4896190a%2Cvariables.5e879b39db022300994ca08a489619a7%2Cvariables.23561c72db922300994ca08a489619c2%2Cvariables.b9299eecdb2e2300994ca08a48961981%2Cvariables.76595220db6e2300994ca08a4896195a%2Cvariables.db46643edb922300994ca08a4896191a%2Cvariables.5afb5e60db6e2300994ca08a489619c1%2Cvariables.0c2998f2db922300994ca08a48961991%2Cvariables.77c19417db622300994ca08a48961978%2Cvariables.4699189bdb622300994ca08a4896197e%2Cvariables.6b7a10dbdb622300994ca08a489619f2
Thanks and Regards,
Raghu
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2019 11:02 PM
Hi Ankur,
Thanks very much for your reply.
sysparm_display_value=true brings 170 records.
sysparm_display_value=false brings 260 records.
So there is a huge difference of 90 records and i analysed each missing record, i did not find any reason that it should filter those many records.
Regards,
Raghu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2019 11:15 PM
Hi All,
Further to this, if i remove all the fields except select only the RITM number, it brings all the records (260) even if the sysparm_display_value=true. Strange!
https://foo.service-now.com/api/now/table/sc_req_item?sysparm_query=cat_item%3Da812c491db022300994ca08a489619c2&sysparm_display_value=true&sysparm_fields=number
Is there any bug or similar issue reported?
Thanks,
Raghu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2019 11:17 PM
Hi Raghu,
Can it be because of the number of fields you are using in the sysparm_fields?
can you try to use 3 or 4 and check?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2019 12:13 AM
Hi,
I am not sure, when i remove some fields especially variables, it is bringing different results (181 results).
For example when i removed %2Cvariables.5afb5e60db6e2300994ca08a489619c1 from the URL, it brings all the records even if syparm_display_value=true. The above variable is a reference field.
https://foo.service-now.com/api/now/table/sc_req_item?sysparm_query=cat_item%3Da812c491db022300994ca08a489619c2&sysparm_display_value=true&sysparm_fields=number%2Csys_created_on%2Cshort_description%2Cpriority%2Cstate%2Cassignment_group%2Cassigned_to%2Csys_created_on%2Csys_created_by2CState%2Cvariables.c3de14f6db922300994ca08a489619c2%2Cvariables.5a20603adb922300994ca08a489619ad%2Cvariables.9005147edb522300994ca08a48961902%2Cvariables.08579739db022300994ca08a489619e9%2Cvariables.27675b39db022300994ca08a4896191c%2Cvariables.4a165872db922300994ca08a4896190a%2Cvariables.5e879b39db022300994ca08a489619a7%2Cvariables.23561c72db922300994ca08a489619c2%2Cvariables.b9299eecdb2e2300994ca08a48961981%2Cvariables.76595220db6e2300994ca08a4896195a%2Cvariables.db46643edb922300994ca08a4896191a
%2Cvariables.0c2998f2db922300994ca08a48961991%2Cvariables.77c19417db622300994ca08a48961978%2Cvariables.4699189bdb622300994ca08a4896197e%2Cvariables.6b7a10dbdb622300994ca08a489619f2
Thanks,
Raghu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2023 11:19 AM
Hi @Raghu
Did you able to fix the issue on getting all records ?