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

How to Use Java functions in Personlization blocks

  • October 17, 2019
  • 4 replies
  • 5653 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

kapilKochar
Level 6
October 17, 2019

You can use below syntax and build your logic accordingly

function toSmartCase(str)

{

  var strLower = str.toLowerCase(str);

   return strLower;

}

asktam1410
Level 3
October 17, 2019

In Personlization block or within campaign workflow?

asktam1410
Level 3
October 17, 2019

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

asktam1410
asktam1410AuthorAccepted solution
Level 3
October 17, 2019

discovered the option.

<%

  var myURL = targetData.UrlLinks;

  var url_length = myURL.length;

%>

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