Grouping based on table name in Attachment API

Sakshi1
Tera Contributor

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.

1 REPLY 1

Tony Chatfield1
Kilo Patron

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?