The ColumnTransformation allows you to rename, reorder, and remove column or property names from your ingoing data. You can provide mappings for renaming and reordering, or flag columns for removal.
This ColumnTransfomration works with strongly typed objects (POCOs) and the dynamic ExpandoObject as input data types. You can specify the columns that need to be removed, reordered or renamed by either using the attributes RenameColumn, ReorderColumn, and RemoveColumn, or assigning instances of the to the corresponding RenameColumns, ReorderColumns or RemoveColumns property.
If no attribute/mapping is provided, the transformation will convert your ingoing data type into an ExpandoObject without any changes. So this transformation can also be used to convert your incoming POCO into a dynamic ExpandoObject.
Note
The ColumnTransformation component will always output as result an dynamic ExpandoObject, regardless of your input type
To rename columns, provide a list via the RenameColumns property. You can also apply the RenameColumn attribute directly to strongly typed object properties. Each rename entry must include the old name and new name. To remove a column, set the RemoveColumn flag to true.
Example using Attributes, using a POCO for the input data:
Example using the RenameColumns property using the ExpandoObject for the whole flow:
Note
When you specify your columns using the `RenameColumns` property, any potential attribute assignment will be ignored.
You can reorder columns using the ReorderColumns property or the ReorderColumn attribute. Specify the new position index for each column to be reordered.
Example:
The resulting ExpandoObject will have the input columns added in the order by the given index property.
Columns can be removed by providing the current name and setting the RemoveColumn flag to true, or by applying the RemoveColumn attribute to the property.