Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Email header masks

ChristineVea
Level 2
Level 2

I am loading personalized mask values for "from name", "reply to address" and "reply to name" & have been able to reference the additional data to populate these values in place of the defaults.   My dilemma is that my client wants to populate with the personalized masks where they are not null and populate with defaults where null. 

I *think* I need to create new content blocks for these but don't know how to create a content block for temp workflow data...  can I write the  if statement with
If ((targetData/fieldname) is empty, 'default content block',(targetData/fieldname)) ??

1 Accepted Solution
chan2111
Correct answer by
Level 4
Level 4

yes you can build your logic in content block as

 

<%

var fieldName = context.targetData.target.fieldname;

var defaultValue = ‘default’;

%>

<%

if (fieldName.length > 0) {%>

   <%=fieldName%>

<%}

else {%>

  <%=defaultValue%>

<%}

%>

 

Please try this out and let me know.

 

 

 

View solution in original post

1 Reply
chan2111
Correct answer by
Level 4
Level 4

yes you can build your logic in content block as

 

<%

var fieldName = context.targetData.target.fieldname;

var defaultValue = ‘default’;

%>

<%

if (fieldName.length > 0) {%>

   <%=fieldName%>

<%}

else {%>

  <%=defaultValue%>

<%}

%>

 

Please try this out and let me know.

 

 

 

View solution in original post