0

I need to display the sender of the email in the email content but during preview/test i keep getting an error

The specified attribute or custom object field name was not found for this client. Function Call: lookuprows(_Job,JobID,JobID) Attribute or Field Name: _Job

Here's my ampscript

%%[ set @jobs = lookuprows(_Job,JobID,JobID) 
if rowcount(@jobs) >= 1 then 
set @fromEmail = field(row(@jobs, 1), 'FromEmail') ]%%  
From Email : %%=v(@fromEmail)=%%
%%[ endif ]%%

1 Answer 1

3

You can not get the FromEmail during previewing the email because JobID will generate after completion of email sent and your AmpScript code is not coded properly. Also, I don't think so there is any Personalization String to get the FormEmail directly. I have modified your code and now, you will get the FromEmail after email sent.

%%[
IF _messagecontext == "SEND" Then
    SET @Jobs = LookUpRows("_Job","JobID",jobid) 
        IF RowCount(@Jobs) > 0 Then 
            SET @FromEmail = Field(Row(@Jobs, 1), "FromEmail") 
        EndIF
EndIF 
]%%

From Email : %%=v(@FromEmail)=%%
1
  • yeah, that makes sense.. Thanks @palashrai !! Used your code and error doesn't show up anymore.
    – sforce
    Commented Mar 9, 2017 at 2:10

You must log in to answer this question.

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