i m using glideAggregate to fetch data from one table that table data are already stored in on array
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 06:39 AM
data.t =[];
var g = new GlideAggregate('table');
g.addQuery('name','IN','data.array');
g.query()
while(g.next())
{
var k ={};
k.n1 = g.name.toString();
data.t.push(k);
}
i m getting blank no data is fetch from table.how to do
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 06:54 AM
I dont understand the use case. You already have names in an array. And again pushing the names in an array? And you could use GlideRecord, there is no use of GlideAggregate here
data.t =[];
var g = new GlideAggregate('table');
g.addQuery('sys_id','IN','data.array');
g.query()
while(g.next())
{
var k ={};
k.n1 = g.name.toString();
data.t.push(k);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 08:03 AM
Change the GlideAggregate to GlideRecord and see if you start getting the data you're expecting.
GlideAggregate is designed for providing a count of the "matching" records; but your script is missing part of the GlideAggregate functions. This makes it look like it should be a GlideRecord which will return records/data from records