Expand my Community achievements bar.

SOLVED

Coalesce/EmptyString function not working

Avatar

Level 4

Hello!

 

I have a challenge to overcome and I hope some of you can help me out here.

I have a special need and I need to check 4 different email attributes in the target mapping before sending out emails to some particular customers.

We have 4 attributes in the recipient table and the hierarchy is as follow:

@Deleted Account- if populated we send the communication 

@email2- we use it if 1 is empty 

@email3- we use it if 1 and 2 are empty 

@Email4- we use it if 1,2 and 3 are empty

 

I tried to use some functions (coalesce and emptyString) but I cannot get a correct result and changing the architecture is unfortunately not an option.

So I need to use a function in the email target mapping that works as explained. 

Thanks in advance

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @A_B_SE ,

You can checkout the below expression,

Iif(@email1 != '', @email1, Iif(@email2 != '', @email2, Iif(@email3 != '', @email3, Iif(@email4 != '', @email4, '' ))))

ParthaSarathy_0-1741332416329.png

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @A_B_SE ,

You can checkout the below expression,

Iif(@email1 != '', @email1, Iif(@email2 != '', @email2, Iif(@email3 != '', @email3, Iif(@email4 != '', @email4, '' ))))

ParthaSarathy_0-1741332416329.png

Avatar

Level 4

Hello @ParthaSarathy , great thanks, it worked wonderfully!