How to Use Java functions in Personlization blocks

Avatar

Avatar

asktam1410

Avatar

asktam1410

asktam1410

17-10-2019

I would like to understand is there anyway to use Java functions in personlization blocks.

Example:- ( length(targetData.filed1) > 0 ) { 'Message A'} 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

asktam1410

Avatar

asktam1410

asktam1410

17-10-2019

discovered the option.

<%

  var myURL = targetData.UrlLinks;

  var url_length = myURL.length;

%>

<% if ( url_length > 0 ) { %><%@ include view='TestLink' %><% } %>

Answers (3)

Answers (3)

Avatar

Avatar

asktam1410

Avatar

asktam1410

asktam1410

17-10-2019

<% if ( length(targetData.prosLinkCheck) > 0 ) { %><%@ include view='TestLink' %><% } %> - is this possible in PB?

Avatar

Avatar

asktam1410

Avatar

asktam1410

asktam1410

17-10-2019

In Personlization block or within campaign workflow?

Avatar

Avatar

kapilKochar

MVP

Avatar

kapilKochar

MVP

kapilKochar
MVP

17-10-2019

You can use below syntax and build your logic accordingly

function toSmartCase(str)

{

  var strLower = str.toLowerCase(str);

   return strLower;

}