Documentation

Server side JS action: converting a JS object to a JSON string

In order to convert a JS object to a JSON string, there are several alternative methods available within a server side JS action:

The easiest one:

var JSONString = JSON.stringify(jsonObject);

or

var objJSON = utils.getJSONObject(obj);
 or
var arrJSON = utils.getJSONList(jsObjectsList);
or
var listResponseJSON = utils.getListResponse(arrObjs, arrObjs.length, false);