Dynamically render template based up on the priority of the div blocks | Community
Skip to main content
Level 5
December 24, 2024
Solved

Dynamically render template based up on the priority of the div blocks

  • December 24, 2024
  • 1 reply
  • 429 views

Hi everyone

 

I have a requirement where, based on the value of targetdata.column1 (e.g., value1), the HTML email template should render only the top 3 blocks.

To provide more context:

The HTML template contains multiple rows that are arranged in order of priority, such as:

  • Row 1
  • Row 2
  • Row 3
  • Row4

If targetdata.column1 equals value1, eligible only for Row 1 and Row 2 should be rendered in the email template. How can I ensure that only these specific rows are displayed?

 

Thank you in advance

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 ParthaSarathy

Hi @rvnth ,

You can define using If conditional element in HTML with || (or)

Example,

<% if ( targetData.column1 == 'value1' ) { %> ROW-1 <% } %> <% if ( targetData.column1 == 'value1' || targetData.column1 == 'value2' ) { %> ROW-2 <% } %> <% if ( targetData.column1 == 'value2' || targetData.column1 == 'value3' ) { %> ROW-3 <% } %>

1 reply

ParthaSarathy
Community Advisor
ParthaSarathyCommunity AdvisorAccepted solution
Community Advisor
December 25, 2024

Hi @rvnth ,

You can define using If conditional element in HTML with || (or)

Example,

<% if ( targetData.column1 == 'value1' ) { %> ROW-1 <% } %> <% if ( targetData.column1 == 'value1' || targetData.column1 == 'value2' ) { %> ROW-2 <% } %> <% if ( targetData.column1 == 'value2' || targetData.column1 == 'value3' ) { %> ROW-3 <% } %>
~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups