Expand my Community achievements bar.

SOLVED

Help: If and statement

Avatar

Level 2

using the Campaign Classic expression editor i'm trying to create the following:

  • If home phone number is null then display mobile phone number.
  • If home phone and mobile phone is  null then display "contact customer care to update your contact information".

I'm having trouble getting this to work and would appreciate some direction.  Below is what i currently have:

Iif(@MOBILE_NUM is Null, @X_HOME_PH_NUM, Iif(@X_HOME_PH_NUM is Null and @MOBILE_NUM Is Null, "Call Customer Services to Update Number – 1-800-RED-CROSS", @MOBILE_NUM))

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Employee

This should give you the desired result:

Iif(@X_HOME_PH_NUM is Null and @MOBILE_NUM Is Null, "Call Customer Services to Update Number – 1-800-RED-CROSS",Iif(@X_HOME_PH_NUM Is Null, @MOBILE_NUM, @X_HOME_PH_NUM))

Thanks,

Ayushman

View solution in original post

3 Replies

Avatar

Correct answer by
Employee

This should give you the desired result:

Iif(@X_HOME_PH_NUM is Null and @MOBILE_NUM Is Null, "Call Customer Services to Update Number – 1-800-RED-CROSS",Iif(@X_HOME_PH_NUM Is Null, @MOBILE_NUM, @X_HOME_PH_NUM))

Thanks,

Ayushman

Avatar

Level 2

worked perfectly.  thank you!  Apparently my issue was with order of operations -- good to know.

Avatar

Employee

I am glad that this worked for you!!!