Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

get DisplyValue from Glideaggregate

Holger Peters
Tera Contributor

Heho,

 

is there any chance to get the displayValue from GlideAggregate as I can get if from GlideRecord.

The thing is, that I want this number formatted. So for a German user I need: "2235,2300000"

 

example code:

var agg = new GlideAggregate('order_price');
agg.addEncodedQuery("some query");
agg.addAggregate('SUM', 'price');
agg.groupBy('price_type');
agg.query();
while (agg.next()) {

var sum = agg.getAggregate('SUM', 'price');
gs.info(JSON.stringify(sum,"",2));
}

 

Output: 

"2235.2300000"

 

7 REPLIES 7

I got get what is solution is

Feel free to share what worked for you

 

Best Regards
Aman Kumar