This is due to the JSON object being converted to a string but the object does not overwrite the parent objects toString method. Here is an example that implements a toString function on the contact:
var contact = {};
contact.toString = function() { return this.firstName;};
if (message.checkNodeExists('/Contact/FirstName')){
contact.firstName = '' + message.getNode('/Contact/FirstName');
}
qie.debug("contact: " + contact);
This returns:
contact: Rich
However, that is probably not what you really wanted to do just to debug it. In this case just use JSON.stringify() like so:
var contact = {};
if (message.checkNodeExists('/Contact/FirstName')){
contact.firstName = '' + message.getNode('/Contact/FirstName');
}
qie.debug("Stringified contact: " + JSON.stringify(contact));
The results:
Stringified contact: {"firstName":"Rich"}
Also, in case you were wondering why the code above has:
'' +
after the equal sign, see this question: