Hello, I have a problem that I can’t find a solution for at the moment.
I’m using a for each to iterate through a data table whose source is an excel file.
I have a column with a code in which I have to process the record of that cell depending on the number with which the code starts, this depends on whether it starts with a succession of 4 numbers, with a different one of 3 numbers and with another more different one of 2 numbers.
My idea was to use a switch using the startswith operator, but it doesn’t work for me as a switch expression.
At the moment I’ve solved it using elseIf, but I’d like to know how to build the flow using switch:
expression> stringVar.StartsWith
case 1> 1234
case 2> 356
case 3> 93
Even though they are numbers in the variable they are strings
switch is expecting values and not statements for the case definitions
In such case we would implement a mapper logic and bring the values / ranges to discrete switch values
The “Switch” activity does not allow expression in case (VB “select case” allows this).
So the option is to use InvokeCode “helper” where you could use the power of “select case” to determine the case.