I have a javascript array including objects and arrays comprise some objects in my channel source in Mirth 3.5.1.For instance:
var sql= "SELECT prop1,prop2,prop3,prop4,prop5,prop6 from ANYTABLE";
var res = dbConn.executeCachedQuery(sql);
var Array1 = [];
Obj1 = {
Prop1: res.getString("Prop1"),
Prop2: res.getString("Prop2"),
Prop3: res.getString("Prop2"),
Array2:[
{
Prop4:res.getString("Prop4"),
Prop5:res.getString("Prop5"),
Prop6:res.getString("Prop6"),
}
]
}
Array1.push(Obj1);
logger.info(Array1) //??
Now I could not achieve to see contents of the objects of Array1 using logger.info()in my server log placed under the dashboard screen.
Are there any solutions or trick to do it?
Convert it to a string first:
You may also need to ensure all the objects at JavaScript rather than Java objects, since JSON.stringify requires objects to implement a toJSON method.