IF statement to handle no firstName in Recipient table | Adobe Higher Education
Skip to main content
thomash82948276
Level 2
December 4, 2018
Resuelto

IF statement to handle no firstName in Recipient table

  • December 4, 2018
  • 5 respuestas
  • 6077 visualizaciones

As is pretty standard, I'm including Firstname in our emails:

<%= recipient.firstName %>, you're almost there!

Could someone let me know how I would add some logic to the above so that in the unlikely event of firstName being blank, the intro line reads only "You're almost there".

So something like:

IF <%= recipient.firstName = null%> THEN "You're almost there", ELSE, <%= recipient.firstName %>, you're almost there!

Just need help with the precise syntax.

Thanks

Tom

Este tema ha sido cerrado para respuestas.
Mejor respuesta de Adhiyan

Hi Tom,

Sorry . Your message appeared in the standard forum hence forwarded you the ACS doc.

Can you simply try this :

<%

if ( recipient.firstName == "" ) {

%>You're almost there!<%

}

else {

%> <%=recipient.firstName %>, you're almost there!<%

}

%>

Regard,
Adhiyan

5 respuestas

Adhiyan
Adobe Employee
Adobe Employee
December 4, 2018

Hi Tom,

You can use the dynamic text option in ACS to define two different variants based on whether a condition is fulfilled.

The product itself will handle the IF ELSE conditions in doing this.

Please check here on how to make this work in detail : Adobe Campaign Help | Defining dynamic text

Regards,
Adhiyan

thomash82948276
Level 2
December 4, 2018

Thank you, is there an equivalent of this in Adobe Campaign Classic?

thomash82948276
Level 2
December 4, 2018

So, I've put this into the email, but it's incorrect.  It's failing to proof.  Can anybody point out where I've gone wrong please?

<%

if ( recipient.firstName IS NULL ) {

%>You're almost there!<%

}

else {

%> <%=recipient.firstName %>, you're almost there!<%

}

%>

Adhiyan
Adobe Employee
AdhiyanAdobe EmployeeRespuesta
Adobe Employee
December 4, 2018

Hi Tom,

Sorry . Your message appeared in the standard forum hence forwarded you the ACS doc.

Can you simply try this :

<%

if ( recipient.firstName == "" ) {

%>You're almost there!<%

}

else {

%> <%=recipient.firstName %>, you're almost there!<%

}

%>

Regard,
Adhiyan

Naresh_Baradi
March 12, 2024

Hi Tom, 

 

You can try this with a capitalization of the name as well. 

 

Iif(Length(@firstName) < 16 AND @2503248 != '',Smart(@firstName)

 

Regards, 

Naresh