Switch (question)

Hello all, i need some help.
I have 3 bool variable and only one of them is “True”. And “result” variable
If bool A true need i create assign result = “A” , If bool B, assign result = “B”, and C same
How i can do it with switch activity ? i can do it only with if activity

have a look here:

the boolean value was converted into an integer resultiung to 1 or 0
A code can be constructed by bringing the converted Boolean Integer to String

So in you case you want to switch to the code 111

1 Like

many thanks. And what if i need do more activity. Like: if A= ‘true’ log it and open browser for example.
If b B= ‘true’ log it and open notepad ? is it possible?

maybe some details we do need, but i will try to answer

Switch activity should be configure as working on string (TypeArgument)

Construct your code e.g. as
strCode = Convert.ToInt(True).toString + Convert.ToInt(False).toString

So this will rsult to the codes:
11 = A is True, B is true
01 = A is false, B is true
00 = All is false
01 = A is false, B is true

So based on this codes within the switch you can react as by your need e.g open browser, open notepad


Hi @Arettu63 Try using this way
Created 3 varable as per you only one will be true so if A will be true then B and C will be false, then code will be 100 so it will execute A case… and so on.
Attaching Screen shot and xaml file attach
(upload://fCwXaPJPSwitchCase.xaml (4.9 KB)

1 Like

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