Sys_id using GlideAggregate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2017 07:50 PM
Hi All,
I have written a script to create records in a table with the values from task table. As we are doing some calculations we are using GlideAggregate as we need of the records.
I found that the assisged_to field values are not populated to the respective field.
I tried different ways like task.assigned_to.sys_id. But didn't work. Can we get sys_id in GlideAggregate?
Please suggest.
Thanks in advance,
Jessie

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2017 08:11 PM
Hi Jessie,
Can you help me understand what it is you are trying to accomplish? What is the ultimate result you are hoping to achieve? Perhaps a sample set of table records.
Short answer - no GlideAggregate() does not return sys_ids of the records it counts, it is used as an API access to database functions like MIN, MAX, AVG, and COUNT.
If we can understand what it is you are building, perhaps we can suggest alternatives.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2018 05:59 AM
Chuck,
This statement: " GlideAggregate() does not return sys_ids of the records it counts, it is used as an API access to database functions like MIN, MAX, AVG, and COUNT. ", is something that should be added to the DOCS for GlideAggregate().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2017 10:23 PM
Hi Jessie,
Here goes some pointer that may be useful:
a) GlideAggregate requires a couple of tricks to work based on "dotted-walk" fields. The following thread can help you understanding that: Get Distinct for Dot-walked Value i.e. Aggregate query on Incident to get unique values of Problem.A...
b) A GlideAggregation will just retrieve to you the "values" for which you're "aggregating". It appears you're rather trying to fix a set of records where the assignment group is X for it to then be Y... or perhaps just to merely retrieve the sys_ids of the records which assignment group is X. If this is the case, you don't need a glide aggregate but rather just a simple Glide Record. If you user an order by within the glide record you can display a list of sys_id, task number and assignment group to make an analysis of your current data. If you want to modify the assignment groups of these records you can just insert some if conditions while looping your GlideRecord where if a group is X you set it to be Y group.
I hope this helps.
Thanks,
Berny