4 boolean Values leading to 16 activities - how to group intelligent?

Hi all,

i am searching for a possibility , to group 4 boolean variables in a strategic order, to work then with a flow switch or something similar.

Example:

Var1 - False , Var2 - False , Var3 - False , Var4 - False >> outcome should be 1
Var1 - False , Var2 - False , Var3 - False , Var4 - True >> outcome should be 2
Var1 - False , Var2 - False , Var3 - True , Var4 - False >> outcome should be 3

ans so on - to the 16 variations

How would you solve this? don´t think with an IF activity …

make a mask similar a bit mask and use it within a switch activity (string type)

grafik

So in your case:
arrFlags = {var1, var2, var3, var4} | DataType: Boolean( )
String.Join("",arrFlags.Select(Function (x) Convert.ToInt32(x).toString))

By using the default branch you can maybe omit some cases as well

@ppr ,

thanks for the tip , how would you then proceed to assign these 16?

with a multiple assign ? - its not possible to have 0000 in the case of the flow switch

outcome = If(string=“0000”, “1”, “”)

or would you do something like that in a invoke code?

IF
caseID=1
ELSEIF
caseID=2
ELSEIF
caseID=3
…and so on to 16 variations.

thank you again for some support!:smiley:

@JayLee
let me try to answer as I am not sure if I got you in all points.

A general flow would look like this:

Also working the flow switch

the invoke code and nested if/else approach is not recommended. The switch approach ius preferred

@ppr

oh, yes , thats what i aim to do! :+1: General flow with those cases !

Many thanks for your time!

i overlooked the typeArgument String (because i wanted first to have the first case 0000 is my case 1 - then it is not working , cause i have int32 in the typeArgument)

Thanks again!
Jay

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