Expand my Community achievements bar.

Join us for Adobe Campaign Community Q&A Coffee Break on Thursday, March 7th at 8am PT with Eric Perrin, Gael Mouello, Chakravarthy Kalva, Bruce Swann and Sandra Hausmann.
SOLVED

if and else if statement syntax for an expression in enrichment activity

Avatar

Level 4

Hi All,

 

Could anyone please help on "if and else if statement syntax" used in an expression in enrichment activity?

 

Thank you,

Rutuja Kelkar

1 Accepted Solution

Avatar

Correct answer by
Level 6

Hello @Rut7,

 

Let say you want to do the equivalent of :

if (@gender == 1){
	logInfo('Male');
} else if (@gender == 2){
	logInfo('Female');
} else {
	logInfo('unknown');
}

 

That would be :

 

Iif(@gender = 1,'Male',Iif(@gender = 2,'Female' ,'unknown'))

 

Br,

Amine

View solution in original post

1 Reply

Avatar

Correct answer by
Level 6

Hello @Rut7,

 

Let say you want to do the equivalent of :

if (@gender == 1){
	logInfo('Male');
} else if (@gender == 2){
	logInfo('Female');
} else {
	logInfo('unknown');
}

 

That would be :

 

Iif(@gender = 1,'Male',Iif(@gender = 2,'Female' ,'unknown'))

 

Br,

Amine