Expand my Community achievements bar.

SOLVED

How to Use Java functions in Personlization blocks

Avatar

Level 4

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

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

1 Accepted Solution

Avatar

Correct answer by
Level 4

discovered the option.

<%

  var myURL = targetData.UrlLinks;

  var url_length = myURL.length;

%>

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

View solution in original post

4 Replies

Avatar

Community Advisor

You can use below syntax and build your logic accordingly

function toSmartCase(str)

{

  var strLower = str.toLowerCase(str);

   return strLower;

}

Avatar

Level 4

In Personlization block or within campaign workflow?

Avatar

Level 4

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

Avatar

Correct answer by
Level 4

discovered the option.

<%

  var myURL = targetData.UrlLinks;

  var url_length = myURL.length;

%>

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