There are two ways to accomplish this, if there are only a couple comparisons then you can use the OR statement, but if it is a large list, it may make more sense to create a sort of delimited string and utilize the IndexOf() function. (or you can build the delimited string and utilize as a rowset as well).
Option 1:
%%[ SET @value = AttributeValue("myCountry")
IF @value == "Spain" OR @value == "Germany" THEN ]%
YOUR CONTENT
%%[ endif ]%%
Option 2a:
%%[
SET @value = AttributeValue("myCountry")
SET @lookupValue = CONCAT("|",@value,"|")
SET @countries = "|Spain|France|Canada|"
IF IndexOf(@countries,@lookupValue) > 0 THEN ]%%
YOUR CONTENT
%%[ endif ]%%
if you notice, my delimited string starts and ends with pipes |
on every entry. This is to prevent partial matches, e.g. day would match not just "day", but also match "today" - giving a false positive. Which is why I created a @lookupValue
var, which adds in the |
to the value.
Option 2b:
%%[
SET @value = AttributeValue("myCountry")
SET @countries = "Spain|France|Canada"
SET @rowSet = BuildRowsetFromString(@countries,"|")
FOR @i=1 TO Rowcount(@rowSet) DO
set @row = Row(@rowset,@i)
set @country = Field(@row,1)
IF @value == @country THEN
SET @pass = 1
ENDIF
NEXT @i
IF @pass == 1 THEN ]%%
YOUR CONTENT
%%[ endif ]%%
This one will take the provided delimited string, turn it into a rowset (via BuildRowsetFromString()) and then loop through it comparing the values and if they match, it sets the @pass
var to 1. There is then a conditional IF statement afterwards that will display the content if @pass == 1
.