Switch Case - cannot put multiple lines?

Using For Each Row in an xlsx, if the cell looks like this:

ABC
DEF

How do I get it to detect ABC {enter} DEF, instead of ABC only?

When I use ABC only and put a message box for my variable, nothing is being stored.

Hi @auto,
just a question: what variable type are you using? The both lines written within one cell were read properly as a string by e.g. “get row item” for me - please see the results below:

Hi there,

Sorry I wasn’t clear enough. Reading the row is fine. However, when using it as a Case in a Switch function, I am unable to define it as “ABC {enter} DEF” and can only define as ABC.

As such, whatever function that follows in this condition is unable to execute.

@auto, what happens if you assign your variable as “ABC”+ Environment.Newline+ “DEF”?

it’s the same… doesn’t get picked up at all.

@auto

I have tried to include newline character in switch case statement but cant able to do it.

I got workaround for this , try this if possible

In ASSIGN activity

string_case = system.Text.RegularExpressions.Regex.Replace(string_case,"\n","")

Replacing all the newline characters in the string input before the swtich activity

just tried it. unfortunately doesn’t work too. any other recommendations please?

Hi @auto

Try using a simple replace with vblf, like here:

1 Like

Hello @loginerror

I have same issue :frowning:

how do I use newline in switch case…? and why can’t use this??