Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: rboccuzziyou need to read the data from the input:
rec = self.inputs[0].read()
and then you can refer to the data in the record using subscripts, like this:
rec["Some Field Name"]
or even
rec[1]
if you want to refer by position.
And if you want to understand the metadata (field names and types), you want to look at:
self.inputs[0].metadata, which is a class, and you can do things like:
self.inputs[0].metadata.find("FieldName") to find out if a field exists, and if so, what the postion is. You can also do:
self.inputs[0].metadata["FieldName"] to get at the type of the field.
One place you can look to find example nodes written in Python is the core library. Feel free to look at (but don't change!) some of the python nodes in that library, and you will see examples of code doing some of the things mentioned above.
Cheers
Rich