How to check multiple conditions in an if statement

I would like to check a variable against a dynamic list of values. then if the variables does not match any value in this dynamic list I perform activity. How would i go about doing this?

store your dynamic list of values into a List say lstValues

If lstValues.Contains(variableName)
//sequence - value is present in list
//isequence - value is not present in the list
End If

Karthik Byggari

1 Like

what exactly would the type of that List be? I am having trouble finding a proper value for it.

List<T> where T is String

I need a value i can browse for in the variable type selector like system.list or something

Yes. Click Browse for types and Search for List you will find a List<T>

And then you can select T as string

Karthik Byggari


this is what i get when i try to select that option.

Please find the informative screenshot -

ok that part worked.

now the data I am collecting is stored in type IEnumerable, how do i get that converted to a list. do i need an assign activity?

Use Assign activity to convert ienumerable to list

lst = ienumVariable.ToList

Karthik Byggari

when i try that i get the following error

Seems to be your IEnumerable contains objects instead of strings.

In this case you have to create List

Here instead of string you should select T as Object.