Using AMPscript in one on my email campaigns, I'm pulling data together (from a DE) based on if a family/ single person share the same Policy Number. I then pull their SubscriberKey (ID), Relationship (Type), First and Last Name into a table within the email. A bit like the below table.
Type Last Name, First Name ID
Primary Insured Fruit, Watermelon 2163913
Spouse Fruit, Papaya 2163914
Child Fruit, Durian 2163917
Child Fruit, Longan 2163915
Child Fruit, Lychee 2163916
AMPscript is as followed...
%%[
set @PolicyNumber = AttributeValue("Policy_Number")
IF NOT EMPTY(@PolicyNumber) THEN
set @rows = LookupRows("Policy_data","Policy_Number",@PolicyNumber)
set @rc = RowCount(@rows)
for @i = 1 TO @rc DO
set @row = Row(@rows, @i)
set @fName = Field(@row, "first_name")
set @relationship = Field(@row, "relationship")
set @subscriberkey = Field(@row, "SubscriberKey")
set @lName = Field(@row, "Last_Name")
]%%
<tr>
<td>%%=v(@relationship)=%%</td>
<td>%%=v(@lName)=%%, %%=v(@fName)=%%</td>
<td>%%=v(@subscriberkey)=%%</td>
</tr>
%%[next @i
endif]%%
Table I used.
Policy_Number|Last_Name|First_Name|SubscriberKey|Relationship|EmailAddress
1|Fruit|Watermelon|2163913|Primary Insured|[email protected]
1|Fruit|Papaya|2163914|Spouse|
1|Fruit|Durian|2163917|Child|
1|Fruit|Longan|2163915|Child|
1|Fruit|Lychee|2163916|Child|
2|Pie|Apple|90251091|Primary Insured|[email protected]
2|Pie|Cherry|90251092|Spouse|
3|Baker|Yummy|90257611|Primary Insured|[email protected]
3|Baker|Junior|90257700|Child|
4|Ice Cream|Chocolate|90251111|Primary Insured|[email protected]
The code work and I tested it out on several bits of data with 4 email addresses. All worked and pull the correct data. I then changed those four email addresses to colleagues of mine to show them. But I still received the emails and they didn't. I was wondering if there could be any caching going on? And if so, how to clear it with the DE?
Thanks!