Switch Activity issue - XML Name expected

Hi UiPath,
I passed the below expression in switch,

IF((Value>=1 and <=20),“1”,IF((Value >=21 and <=40),“2”,“Default”))

I am getting an error of XML name expected. can anyone help on this. whats wrong with the expression ?
Switch argument is integer and value varible is also integer. Please respond asap

The 2nd error in the screenshot.

Thanks

Hi,

Can you try the following expression?

IF((Value>=1 AndAlso Value<=20),"1",IF((Value >=21 AndAlso Value<=40),"2","Default"))

Regards,

1 Like
  • what is the case value u have??

  • is your case value “IF((Value>=1 and <=20),“1”,IF((Value >=21 and <=40),“2”,“Default”))
    if u have mentioned “IF((Value>=1 and <=20),“1”,IF((Value >=21 and <=40),“2”,“Default”))” is case value then it is expecting a string not the vb expression

  • You can mention the VB expression on top where it says Expression. If you have mention the expression in the Expression tab and not in the Case tab then pls attach the screenshot of the Switch activity for better understanding

1 Like

Thank You. It worked.

1 Like

Thank You for the explanation.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.