I need some help with a line of AMPScript to enter into the From Name and From Email in the Sender Profile set up page. I am trying to build a dynamic sender profile that will look up a relationship manager ID for each recipient in the sendable data extension, look up that value in a reference data extension, and then return that corresponding value.

I have two Data Extensions:

  • Sendable Data Extension - includes the subscriber info pulled from Sales Cloud, including an ID number for a relationship manager
  • Reference Data Extension - includes a list of relationship manager IDs, their full names and email addresses

The sample line of AMPScript MC keeps pointing me to is the following.

Here is the specific example of the lookup function: %%=Lookup("PostalCode","City","PostalCode",46016)=%%

However, in the case above, its looking to match the zip provided 46016. In my case, I don't want to provide a definitive value in the script. I'm looking for the script to trigger a lookup based on the relationship manager ID that is specific to each subscriber.

Any help would be appreciated!

2 Answers 2


You'll need to reference the Relationship Manager ID in your lookup.

I'd approach it something like this. The AttributeValue() function handles null values gracefully.

var @rmId, @fromName, @fromEmail

/* set the var from the sending DE */
set @rmId = AttributeValue("RelationshipManagerID") 

/* retrieve fromName using @rmId */
set @fromName = lookup("ReferenceDE","fromName","RelationshipManagerID", @rmId) 

/* retrieve fromEmail using @rmId */ 
set @fromEmail = lookup("ReferenceDE","fromEmail","RelationshipManagerID", @rmId)

/* handle if no matching row was found */
set @fromName = iif(empty(@fromName),"Default From Name",@fromName)
set @fromEmail = iif(empty(@fromEmail),"[email protected]",@fromEmail)

Then in your Dynamic Sender Profile you'd reference the @fromName and @fromEmail like this.

From Name: %%=v(@fromName)=%%

From Email: %%=v(@fromEmail)=%%

UPDATE - 2018-03-22

Yeah, this doesn't work properly since the sender profile is processed by the OMM before everything else. This excellent answer outlines the proper solution:

  1. Create a content box and set an External Key e.g. SenderEmail

  2. Create a content box and set an External Key e.g. SendName

  3. Inside your Content Boxes add your ampscript to set Email Name, Email address - though could be done as a simple Set @FromName = 'something' or you could also do a lookup to a data extension.

  4. In you sender profile, add the following to your From Name / From Email boxes %%=ContentAreaByKey("SenderEmail")=%%

  • Have you ever implemented this? I can't get the Sender Profile to actually populate with an AMPscript variable, even though I can prove it rendering correctly by outputting the variables in the body of the email. Commented Aug 28, 2017 at 18:31
  • Putting %%=v(@fromName)=%% in the From Name in Sender profile doesn't work. Instead if I put the whole lookup statement, it works
    – Maneesh
    Commented Mar 22, 2018 at 2:58
  • Noted. Updated my answer. Commented Mar 22, 2018 at 11:31
  • Are there any RMM implications to this? I was able to get an if statement with a lookup to work all inside the sender profile to work, but I don't feel good about it... something doesn't feel right, like it will break. Commented Jul 20, 2018 at 21:36

We can also achieve this by populating substitution strings in the sender profile for the profile attributes containing sender's details. Please correct me if this is wrong.

  • 1
    You should add more details in your answer. One line input may not help. If you want to provide just pointer then use comments section. Commented Jul 25, 2016 at 11:48
  • It says that I should have atleast 50 reputation to comment. Commented Jul 25, 2016 at 11:56

You must log in to answer this question.

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