How to Use Java functions in Personlization blocks | Community
Skip to main content
asktam1410
New Participant
October 17, 2019
Solved

How to Use Java functions in Personlization blocks

  • October 17, 2019
  • 4 replies
  • 5648 views

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.
Best answer by asktam1410

discovered the option.

<%

  var myURL = targetData.UrlLinks;

  var url_length = myURL.length;

%>

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

4 replies

asktam1410
asktam1410AuthorAccepted solution
New Participant
October 17, 2019

discovered the option.

<%

  var myURL = targetData.UrlLinks;

  var url_length = myURL.length;

%>

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

asktam1410
New Participant
October 17, 2019

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

asktam1410
New Participant
October 17, 2019

In Personlization block or within campaign workflow?

kapilKochar
New Participant
October 17, 2019

You can use below syntax and build your logic accordingly

function toSmartCase(str)

{

  var strLower = str.toLowerCase(str);

   return strLower;

}