Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards
SOLVED

Can I have an AND condition in my if conditional statement?

Avatar

Level 8

I would like to add an AND statement to my conditional statements in campaign. Is that possible and what is the syntax? I only found this article describing the syntax: https://experienceleague.adobe.com/en/docs/campaign-web/v8/content/dynamic-content/conditions


<% if (recipient.gender == ${model.gender} ) {
%>

<p> Conditional content </p>
<% }
else {
%>
<p>Default Content</p>
<% } %>
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @anasustic ,

Yes, you can add.

<% if (recipient.firstName == 'abc' && recipient.lastName == 'xyx' ) { %>

 

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi @anasustic ,

Yes, you can add.

<% if (recipient.firstName == 'abc' && recipient.lastName == 'xyx' ) { %>

 

Avatar

Level 8

Hi @ParthaSarathy 
Is the OR operator in the if statement allowed and are two AND operators in the if statement allowed?

 

Avatar

Community Advisor