If Else Condition variable value compare with case value

I am trying to use IF Else conditions in RPA Recorder. I want to read value from the excel sheet and then compare the value to the conditions in If Else. Depending on the conditions I will program the remaining course of action. The image of what I did so far is attached below.
image

Thanks

@hassanjamshaid

Hi Hassan, does the script above not work?

Alesia

Yes, The code is working. It is going into the else condition. What I want to learn is that I read the text “ReadyLine” from my excel sheet. After this I want to compare the read text from excel sheet and then saved in the variable with the condition text “ReadyLine”. Meaning “ReadyLine” = “ReadyLine”. How can i do it so the condition becomes true.

Thanks.

@hassanjamshaid

I hope I understood your request correctly.
After you have entered the condition (in your case: ${variable} eguals (=) ReadyLine) you have to create the set of actions when the condition is true (Then true) and the set of actions when it is not true (Else true). Please let me know if I didn’t understand your request correctly or if you need a sample recording.

When you read from excel cell, the ‘line break’ character also comes along with the string. So, you have to strip that ‘line break’ character and then compare.

One way to do that is to read that cell value into a List (use ‘Linux/Unix …’ separator) and then read the first element of the resulting List.

1 Like

Yes. That’s what I was asking. Thanks.

can u please share a sample program.
thanks

Sure,

Here is a sample recording.
excel-if-else.rar (6.5 KB)

It was made using version 2.0.5.