Forum Discussion
bojanvelevski
5 years agoValued Contributor
Hi @Tanmay_Sarkar,
You can also use Apache Velocity within JSON Generator. Here is the script:
#set($sum = 0)
#foreach ($field in $group)
#set($sum=$sum+$field.key2)
#end
#foreach($field in $group)
#set($dummy = $field.put(“sum”,$sum))
#end
{“group”:$group}
Regards,
Bojan
- Tanmay_Sarkar5 years agoNew Contributor III
@bojanvelevski Thanks a lot, I never realized Apache Velocity can be used within JSON generator in such a way, this would come in handy in future.