Copy column identified in flow variable to new column

Hello,

 

This should really be simple but I cannot seem to work out how to do it - maybe because it is the weekend. I have the name of a column in a flow variable (the actual column can change) and would like to copy the contents of that column to one with a defined name. The Math Formula node does not seem to allow dynamic access to columns so I have been trying using a Java Snippet but cannot get it to work (probably due to the fact that I am not a java programmer).

 

I have been trying to use getCell as in:

return(getCell($${Sdata_field}$$,"Double"));
and keep getting a 'the method is undefined' error using like this. However, I cannot work out what getCell is a method of in the Java snippet.
 
I would be very grateful if someone could let meknow how I should be using this - or even if there is a better way to achieve the same thing than using a java snippet.
 
Cheers,
 
Christian

You can use the rule engine node to this. Simply make the variable setting in the outcome box of the rule engine node. I think you may need to append dollar signs to either end of the column name first.

simon.

Thanks for the advice. Never used that node before but it worked like a charm.

Cheers,

Christian

Also the Column Merger seems like it would be appropriate no?