0

I have an ampscript code here that shows all the fields that has values. If there is no Value, it should show "N/A" as its value, For the fields that has values, it should be clickable then if the field doesn't have a value, it should show the "N/A" value and it shouldn't be clickable. But on my case, even if it has the right value or just the N/A, it is still clickable. Any other options to make the N/A unclickable? Here is the output:

Sample photo

Here is the Ampscript code:

   %%[
VAR @BDM, @CDBP, @CSN, @CSO, @CS1, @CS2, @CS3, @CS4

 IF EMPTY(BDM_Email)
    THEN SET @BDM = "N/A"
    THEN SET @CS1 = "BDM"
  ELSE SET @BDM = BDM_Email
    SET @CS1 = "BDM"
 ENDIF

 IF EMPTY(CDBP_Email)
    THEN SET @CDBP = "N/A"
    THEN SET @CS2 = "CDBP"
  ELSE SET @CDBP = CDBP_Email
    SET @CS2 = "CD BP"
 ENDIF

 IF EMPTY(CSN_Email)
    THEN SET @CSN = "N/A"
    THEN SET @CS3 = "Customer Service"
  ELSE SET @CSN = CSN_Email
    SET @CS3 = "Customer Service"
 ENDIF
 
  IF EMPTY(CSO_Email)
    THEN SET @CSO = "N/A"
    THEN SET @CS4 = "CD Ops"
  ELSE SET @CSO = CSO_Email
    SET @CS4 = "CD Ops"
 
ENDIF ]%%

for the HTML: <div style="line-height: 150%;"> <span style="font-family:Arial,Helvetica,sans-serif;"><b><span style="color:#000000;"> <span style="font-size:24px;">Your Team</span></span></b></span></div><div style="line-height: 150%;"> <span style="font-family:Arial,Helvetica,sans-serif;"><span style="font-size:11px;">Looking for something specific? We are here for you!</span></span><p style="line-height: 100%;"> <span style="font-family:Arial,Helvetica,sans-serif;"><span style="font-size:11px;">%%=v(@CS1)=%%</span><br> <span style="font-size:11px;"><a href="mailto:data-amp-placeholder-2-amp-end">%%=v(@BDM)=%%</a></span></span></p><p style="line-height: 100%;"> <span style="font-family:Arial,Helvetica,sans-serif;"><span style="font-size:11px;">%%=v(@CS2)=%%</span><br> <span style="font-size:11px;"><a href="mailto:data-amp-placeholder-5-amp-end">%%=v(@CDBP)=%%</a>&nbsp;</span></span></p><p style="line-height: 100%;"> <span style="font-family:Arial,Helvetica,sans-serif;"><span style="font-size:11px;">%%=v(@CS3)=%%</span><br> <span style="font-size:11px;"><a href="mailto:data-amp-placeholder-8-amp-end">%%=v(@CD_OPS)=%%</a></span></span></p><p style="line-height: 100%;"> <span style="font-family:Arial,Helvetica,sans-serif;"><span style="font-size:11px;">%%=v(@CS4)=%%</span><br> <span style="font-size:11px;"><a href="mailto:data-amp-placeholder-11-amp-end">%%=v(@CSO)=%%</a></span></span></p></div>

Miguel
  • 1

1 Answers1

0

The easiest way would be to utilize the AMPscript within the HTML, by wrapping it inside the IF/THEN statement.

For example:

<p style="line-height: 100%;font-family:Arial,Helvetica,sans-serif;font-size:11px;">
BDM <br> 
%%[IF EMPTY(BDM_Email) then]%%
  N/A
%%[else then]%%
  <a href="mailto:data-amp-placeholder-2-amp-end">BDM_Email</a> 
%%[endif]%%
</p>