cancel
Showing results for 
Search instead for 
Did you mean: 

Switch Statement Message Mapping

Former Member
0 Kudos

Hi,

Is there any way to reproduce a switch statement using the graphical message mapping?

Eg:

switch (value) {

case 1

map AA

case 2

map BB

...

...

thanks

Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

use an IF else option.

Former Member
0 Kudos

OK. Doesn't make for a pretty mapping when there are 20 IF Else's.

Thanks,

Former Member
0 Kudos

Hi Gareth,

For simple mappings, a value lookup fixed (or not) might do it. or an UDF

Shabarish_Nair
Active Contributor
0 Kudos

from a readability perspective, if there are a huge number of conditions, i personally prefer a UDF than using the standard if else function.

Former Member
0 Kudos

Hi, I used FixValues. This is the same as using a switch statement, and much easier that loads of If Else

Thanks.

Answers (1)

Answers (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Yes, it is possible.

If else is mainly to decide logic for onlly two different condition. If you want to simulate very similar to Switch for more than 2 or multiple condition, Use If without else for all the conditions except the last one where you can use if else.

Example: If you have 10 conditions, first 8 condition go with if without else and last two with if else.

Hope that helps