-1

The manager is the recipient and they may have multiple employees that should be in the list below. I want to lookup manager email and then have the employee first and last name populate in individual rows

For example:

We have not received a response from the following employee(s):
First Name Last Name
First Name Last Name

DE Fields:
FirstName LastName
Manager-Name
Manager-Email

1 Answer 1

1

You should be able to do this with a simple for loop and lookuprows.

In your email:

We have not received a response from the following employees(s):<br>
%%[ 
SET @managerEmail = emailaddr
SET @employeeRS = LookupOrderedRows("myLookupDE", 0, "LastName ASC", "Manager-Email", @managerEmail)

IF ROWCOUNT(@employeeRS) > 0 THEN
  FOR @i=1 TO ROWCOUNT(@employeeRS) DO
    SET @row = ROW(@employeeRS,@i)
    SET @FirstName = FIELD(@row,"FirstName")
    SET @LastName = FIELD(@row,"LastName")
    ]%%
    %%=v(@FirstName)=%% %%=v(@LastName)=%%<br>
    %%[
  NEXT @i
ENDIF
]%%

Which should output something like the below:

We have not received a response from the following employee(s):
John Dorian
Eliot Reed
Percival Cox
Chris Turk

You must log in to answer this question.

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