Help: If and statement | Community
Skip to main content
New Participant
September 27, 2019
Solved

Help: If and statement

  • September 27, 2019
  • 3 replies
  • 4086 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ayushman_108494

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

3 replies

ayushman_108494
Employee
September 30, 2019

I am glad that this worked for you!!!

wpomeroyAuthor
New Participant
September 30, 2019

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

ayushman_108494
ayushman_108494Accepted solution
Employee
September 29, 2019

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