I just can't get this to work.
Thanks in advance
Cheers
// All the vars below are of type string
var reg = msg.payload.registration;
var actype = msg.payload.type;
var alt = String(msg.payload.altitude);
var squawk = msg.payload.squawk;
var time = msg.payload.time;
var hdg = String(msg.payload.hdg);
var message="";
In case you are interested it is considered good practice to re-use the input message rather than creating a new message. That allows users to add data properties (eg msg.mydata)to a message and pass it through nodes without losing the extra information. Also it usually saves a bit of code. So in your case you could replace the end section with