Adding new fields to the dataset is really simple. This is how you do it:
- In the code, you define the field as an internal variable and calculate its value.
- Then you have to update the output row. Supposing that the name for the new field is my_new_field and the name of the internal variable is my_var, you update the output row as follows:
get(Fields.Out, "my_new_field").setValue(outputRow, my_var);
- Finally, you have to add the field to the lower grid. You just add a new line of each new field. You have to provide at least the Fieldname and Type.
In our example, we want to add a field to the length of the word field. ...