Grouping based on table name in Attachment API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2024 05:26 PM
I need to do grouping on records on Attachment API(api/now/attachment) based on tablename. I am using below query but it is not working as expected:
https://<instance-name>/api/now/attachment?sysparm_offset=<offset>&sysparm_limit=<limit>&sysparm_query=sys_updated_on>=2024-05-17T14:00:10Z^sys_updated_on<=2024-07-04T19:30:00.061Z^GROUPBYtable_name
What is the difference in GROUPBY and sysparm-group_by ? Which one is prescribed to use in the above use case?
Please help with inputs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2024 06:53 PM
Hi, GROUPBY is a url parameter for use within the platform for grouping records in UI list view.
sysparm_group_by is a parameter specific to GlideAggregate API
Aggregate API | ServiceNow Developers
and is not part of the Attachment API Attachment API | ServiceNow Developers
Testing in a browser with the url you have posted, GROUPBY does appear to change the order of the returned records,
but there is no logic in attempting to 'group' individual records and ORDERBY might be a more appropriate method?