0

I'm just curious about switch/case in UiPath. Everywhere else in UiPath, strings must have double quotes or stored in variables, however in switch/case, it seems different.

Every "case" is interpreted as string, regardles of the quotes. How to use variables in there when they're interpreted as string?

toffler
  • 1,231
  • 10
  • 27
  • You can't set a variable in Case, as a workaround you can check this: https://forum.uipath.com/t/switch-case-with-variable-at-case/234560 – Ahmad Hijazi Jun 14 '22 at 07:41

1 Answers1

1

You cant use variable in switch case in UiPath. However you can use following expression in Expression property helps switch dynamically.

Array.IndexOf({var1,var2,var3},item.ToString)

Something like below screenshot

Variable in Switch Case

Hope this helps

Ankit Roy
  • 44
  • 5