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

How to use operator "OR" in a conditional statement

Avatar

Avatar
Validate 1
Level 2
alik98709228
Level 2

Likes

3 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
alik98709228
Level 2

Likes

3 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
alik98709228
Level 2

11-01-2018

Hi,

I am using following conditional statements to display 4 different images based on 4 different values (1, 2, 3, or 4) in TREATMENT_ID column. The following conditional statement is working, however i want to edit it to use "OR" since the image is the same for the values 1 and 2:

<% if (targetData.TREATMENT_ID == '1'){%>

<img class="setImageFull" src="http://img/image1.png" width="600" height="82" alt="Rewards Certificate"/>

<% } else if (targetData.TREATMENT_ID == '2'){%>

<img class="setImageFull" src="http://img/image1.png" width="600" height="82" alt="Rewards Certificate"/>

<% } else if (targetData.TREATMENT_ID == '3'){%>

<img class="setImageFull" src="http://img/image3.png" width="600" height="82" alt="Rewards Certificate"/>

<% } else if (targetData.TREATMENT_ID == '4'){%>

<img class="setImageFull" src="http://img/image4.png" width="600" height="82" alt="Rewards Certificate"/>

<%}%>

Here is the edited code. Does this would work:

<% if (targetData.TREATMENT_ID == '1') Or (targetData.TREATMENT_ID == '2')  {%>

<img class="setImageFull" src="http://img/image1.png" width="600" height="82" alt="Rewards Certificate"/>

Thanks!

AK

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 3
saikatk2447661
Level 3

Likes

22 likes

Total Posts

57 posts

Correct Reply

14 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 3
saikatk2447661
Level 3

Likes

22 likes

Total Posts

57 posts

Correct Reply

14 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
saikatk2447661
Level 3

11-01-2018

Use || instead of Or.

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
MVP
david_garcia1
MVP

Likes

106 likes

Total Posts

182 posts

Correct Reply

41 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
MVP
david_garcia1
MVP

Likes

106 likes

Total Posts

182 posts

Correct Reply

41 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
david_garcia1
MVP

12-01-2018

Adobe Campaign Help | Advanced expression editing

<% if (targetData.TREATMENT_ID == '1' || targetData.TREATMENT_ID == '2') {%>