Switch statement doesn't work with variables; any work around

I cannot fathom why the very useful switch statement doesn’t work with variables in UIPath, but I guess that is just the way it is. Sure seems like it kind of hobbles this statement.

I have attached a XAML and picture. I want to easily be able to test a string against a list of strings with an arbitrary number of items. Man, seems like the switch statement would do it.

Any workarounds?

SwitchNotWorking.xaml (6.9 KB)


How about IndexOf method as the following?