Skip to main content
asktam1410
Level 3
Oct 17, 2019 1:34 PM UTC
Solved

How to Use Java functions in Personlization blocks

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

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
asktam1410
asktam1410Accepted solution
Level 3
Oct 17, 2019 5:10 PM UTC

discovered the option.

<%

  var myURL = targetData.UrlLinks;

  var url_length = myURL.length;

%>

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

4 replies

kapilKochar
Level 6
Oct 17, 2019 1:48 PM UTC

You can use below syntax and build your logic accordingly

function toSmartCase(str)

{

  var strLower = str.toLowerCase(str);

   return strLower;

}

Translate
asktam1410
Level 3
Oct 17, 2019 2:17 PM UTC

In Personlization block or within campaign workflow?

Translate
asktam1410
Level 3
Oct 17, 2019 2:19 PM UTC

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

Translate
asktam1410
asktam1410AuthorAccepted solution
Level 3
Oct 17, 2019 5:10 PM UTC

discovered the option.

<%

  var myURL = targetData.UrlLinks;

  var url_length = myURL.length;

%>

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

Translate