Dynamic selector with c#

I have a data table that has only one column. I am running inside a For Each Row activity.

I am trying to use “line[0].ToString()” in the selector but get an error.

How do I do this. I am doing this in C#.

image

Thanks,

Tom

Hi @tfs

if you talk about the negative validation result for the selector…this is common.
It is not working with dynamic selectors.

Did you do a test run?

I am assuming the negative validation result is due to the message at the bottom left where it says “…line[0].ToString()” is not defined in this scope.

This is contained in the “For Each Row” activity, so “line” is in the scope.

I think the problem is that the {{ }} expects a variable only so it thinks that whole statement is a variable and not just “line”.

I was able to make it work by using the same statement in an assign activity to my “temp” variable and putting “temp” inside the braces.

I was trying to get this to work without using a variable as I saw in other places - but it apparently doesn’t work.

In other examples, it shows the statement inline (but that may be only for VB and not C#).