I am sending a winback campaign to former merchants based on a recurring Salesforce report that is imported to a data extension. Since sometimes an email address is used on more than one account that has left us (and each record has a different contact ID), I've used a SQL query to deduplicate by email and used the resulting DE as the journey's entry source to avoid sending the same email to the same address multiple times.
If a contact clicks on the email, a task is created for our sales team to follow up. But I would like to list in the task all the accounts associated with the email address so that none of them get missed even though they're not in the original entry source. I linked the original, un-deduped DE in the contact model with a one to many relationship based on the email address, but using the contact attribute for the account name in the subject line of the task only inserted one of the account names when I tested it.
Is there any solution that would fit my use case: deduplicate the entry DE by email address but reference the un-deduplicated list of account names in the task?
I think you're close to a solution with what you've outlined. There's no way to loop through different rows in a data extension within a task creation. If you were able to generate a data extension that combined all of your matching records in the un-deduped DE into a single row for each duplicate email, you could then reference that data extension and output.
i.e. if your un-deduped DE looked like this:
accountID email
12345 repeatemail@domain.tld
23456 repeatemail@domain.tld
34567 repeatemail@domain.tld
45678 uniqueemail@domain.tld
You would have a un-deduped, combined DE generated by SQL that looked something like this:
email accountIDs
repeatemail@domain.tld 12345, 23456, 34567
uniqueemail@domain.tld 45678