Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

The 4th edition of the Campaign Community Lens newsletter is out now!

Recipient is not defined

Avatar

Level 5

Hi,

I am using a javascript that should work both for RECIPIENT and LISTS in this way:

<%

...

function isEmpty(val){

    return (val === undefined || val == undefined || val == null || String(val).length <= 0) ? true : false;

}

var user;

if(!isEmpty(recipient.crmId)){

     user = String(recipient.crmId);

}else{

     user = String(targetData.crmId);

}

...%>

I am testing this script with 2 cases:

1) Query on recipient + delivery #1 -> it works

2) Query on list + delivery #2 -> it does not work

I get this error when I am using a list (target mapping of the delivery is "external file" and there is no "recipient" inside the delivery template):
JST-#ID# Error while compiling script 'content htmlContent' line 6186: recipient is not defined. SCR-#ID# JavaScript: error while evaluating script 'content htmlContent'

so I'm guessing that the issue is inside the IF above (not working as I were expecting).

Anyone could tell me how to solve it?

Thank you,
Salvatore

Jean-Serge Biron

inactiveforumnotifier

Amy_Wong

Woojin

Debbie

Adobe Campaign

0 Replies