I’m trying to write a short Lookup script for a Dynamic Sender Profile and I’m struggling with it.

I have an email that I want to send to the members of a Data Extension, and I want the email come from the Account Executive assigned to each member of that Data Extension.

Here’s the script I’ve written and I’ll describe what I wrote and why I wrote it the way I did:

%%SET @email = Lookup(‘User.Copy’, ‘Email’, ‘Name’, ‘%%Account Executive%%’)%%

@email is the variable I’m setting. I want this to be the Account Executive’s email address, and it will populate in the From Email field of the Dynamic Sender Profile.

User.Copy - This is the Data Extension that contains the Account Executive’s email address.

Email - This is the column name in the User.Copy Data Extension that contains the Account Executive’s Email Address

Name - This is the column name in the Data Extension that I want to match on. I’m passing in the name of the Account Executive, and want to return the email of the Account Executive.

%%Account Executive%% - This is the name of the Account Executive. It’s coming from the Data Extension that contains the subscribers I want to send the email to.

When I send a test email, the AMPscript doesn’t fire. It just populates the AMPscript in the From Email of the email, and doesn’t populate the Account Executive’s email address. When I click Reply on the email, the Reply-To email address reverts to our Default Reply-To email address.

Any advice or troubleshooting you can offer on the script above?

  • Update: Thank you for the feedback and for reviewing my question. We ended up getting the following solution to work: For the From Name field, we used a personalization string. The value we wanted to display was in the DE we were sending to, so no need for AMPscript. For the From Email field placed the AMPscript in a Content Block and then referenced the Content Block in the From Email field. The value in the From Email field looks like this: %%=ContentBlockbyId("3477")=%% All tests have worked, and we should be able to use the script for other sends. Thanks for your help! Commented Apr 7, 2020 at 18:49

1 Answer 1


Aside from not using curly quotes, you'll need to use an AMPscript block and then use inline notation for the output.

You can't mix AMPScript blocks and inline code, you'll need to reference your personalization string differently. AttributeValue will return an empty string if Account Executive doesn't exist in your send context.


var @email
set @email = Lookup("User.Copy", "Email", "Name", AttributeValue("Account Executive"))


You must log in to answer this question.

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