In Rules Engine Node, How do I select a column based on variable?

So, I have several columns:






Then, I have a variable and it has a name for one of the columns:



I want to do this:

TRUE => One of the columns that matches the text in Var1

$COL1$ = Var1 => TRUE

Sorry, bud, but this is not it. This will check the value in col1 against the variable and then give True/False outcome. This is not what I am trying to do. I want the name of the column to be compared to the variable and then the outcome be the value in that column.

I don't think this is possible with just a single Rule Engine node. I once had a similar requirement and went for the following:

Create the rule for each row dynamically before the Rule Engine, and pipe it to the Rule Engine as a flow variable. Surround everything with a loop, so that each row is processed in isolation.

I'll attach an example.

Thank you qqilihq. I will look into it this weekend. I'll post an update on your method later.