Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
To clarify a few things above if they were not clear and give a little background if it helps. In the for loop we cycle through every field on the input pin. Obviously some fields could be boolean, doubles, unicode, dates etc. meaning that if you want to concatenate them all together as a string you would need to convert them to a string/unicode. Python does not like when you don't handle nulls specifically. In BrainScript you could just do something "emit string1 + string2 as joinedstring" and if string1 was null, it would not care and basically just take it as an empty string.
Back to the for loop. The variable fn will be the field name, fv will be the field value and ft will be the field type. It sounds like you just want to concatenate all your fields together, so we probably don't really care about the field type per se but we do need to handle the nulls that may or may not be present. That's my long winded explanation, hopefully it will help you understand a little more with using the Transform node. Now here's the modified script:
out1 += in1
data = ''
# fn is field name. fv is field value. ft is field type
for i,fn in enumerate(in1):
field = inputs[0].metadata().field(i)
ft = in1.metadata().typeName(field.type())
fv = in1[fn]
fv_uni = unicode(fv) if fv is not Null else '' # convert all fields to unicode
data += '|' + fv_uni # concatenate all fields together
out1.Data = data.strip('|')
