I'm not sure if this is easily done somehow.

But I want to make some AMPscript to show one image, if the recipient is in one dataextension (Male dataextension) and another image if the recipient is in the female dataextension.

The reason why I'm not simply looking at the Gender is because the dataextensions with the genders are not just looking at gender, and it is sometimes changed. So I would just like the AMP script to follow how the dataextension is made.

I was thinking something where it looked up the recipients e-mail to see if it was in the male dataextension and elseif it was in the female dataextension.

Is there an easy way of doing that?

  • If my answer helped, please mark it as accepted, so others can easily see this is a working solution. Thank you! Jul 28, 2017 at 20:54

1 Answer 1


You can use the LookupRows-function and then RowCount-function to check if the subscriber is on the data extension and output the image within a if-/else-statement. In the following example you need to change the data extension name as well as the column name containing your subscriber's key.

Example code:

    Var @count
    Set @count = RowCount(LookupRows("Male", "YOUR_SUBSCRIBER_KEY_COLUMN", AttributeValue("_subscriberkey")))

    IF @count == 1 THEN
    <img src="maleImage.jpg" />
%%[ ELSE ]%%
    <img src="femaleImage.jpg" />
%%[ ENDIF ]%%

Related documentation articles:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .