Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!

issue in personalization block

Avatar

Level 4

Hi Team, 

 

I am just loading the csv file with some feilds into delivery and sending the emails through external file target mapping. In the delivery i am using a personalization block which will display the value based on the values which are used in the uploaded file. 

 

Employee IDLegal Name - Last NamePreferred Name - First NameEmail AddressJob Category
16105GraceJessicaJessica.Grace@dynata.comCorporate
16171McGahheyEricEric.McGahhey@Dynata.comCorporate

 

Above is the file i have uploaded to server and sending the emails. and in the delivery i am using the value based on job category feild. 

 

if category = 'corporate' i need to show 1 

if category = 'call center' i need to show 2

 

my personalization block : 

 

 

<%if ( dataSource.Job_Category =="Corporate" ) { %>1<% } else if ( dataSource.Job_Category =="Call Center") {%>2<% } %>

 

in my delivery i am using this personalization block : 

 

<a href="https:XXXXT/en-US?type=<%@ include view='Workday_Parameters' %>" _label="Text" target="_blank">https:XXXXT/en-US?type=<%@ include view='Workday_Parameters' %></a>

 

Error i am getting : 

 

JST-#ID# Error while compiling script 'content htmlContent' line 7: XSV-#ID# Unable to set the value 'Corporate' to property 'dataSource.Job_Category' because the object is read-only.. SCR-#ID# Javascript&colon; error while evaluating script 'content htmlContent'.

 

 

6 Replies

Avatar

Level 9

Hi @Ramaswami - try adding a final else{} statement to your else if{}

<%if ( dataSource.Job_Category =="Corporate" ) { %>1<% } else if ( dataSource.Job_Category =="Call Center") {%>2<% } else {} %>

 

 

Avatar

Level 4
Hi @Dareen, i can't able to add this in <a> tag. if i use this in href like <a href="http://xx.com/<include personalizationblock>"></a>.. its given me the link as http://xx.com/123 ( it should be 1 or 2 or 3 but not 123 )

Avatar

Community Advisor

Hi,

 

Does it say dataSource.Job_Category =="Corporate" or dataSource.Job_Category ="Corporate"?

 

Thanks,

-Jon

Avatar

Level 4
it says job_category == 'corporate' and its working now. thanks for the reply nick

Avatar

Level 4

hi @Jonathon_wodnicki

 

It's working if i include the personalization block normally but when i include in hyperlink it's not working. 

 

my personalization block: 

ExitSurvey : 

<%
if ( dataSource.Job_Category == "Corporate" ) { %>1<%
} %><%
else if ( dataSource.Job_Category == "Call Center" ) { %>2<%
} %><%
else if ( dataSource.Job_Category == "XXXXXXX" ) { %>3<%
} %><%
else { %>0<%
} %>

 

my hyperlink : 

 

i tried below ways : for (Job_Category == "Call Center")

way 1: 

<a href="https://domain/6CD9B920/G10DF6LT/en-US?type=<%@ include view='ExitSurvey' %>" target="_blank">https://domain/6CD9B920/G10DF6LT/en-US?type=<%@ include view='ExitSurvey' %></A>

output :  https://domain/6CD9B920/G10DF6LT/en-US?type=2 when i click this link the redirect link i am seeing is : https://domain/6CD9B920/G10DF6LT/en-US?type=1230

it is including all '1230' not using the conditional block used in personalization block when i use the block inside href

 

way 2: 

<a href="https://domain/6CD9B920/G10DF6LT/en-US?type="+<%@ include view='ExitSurvey' %> target="_blank">https://domain/6CD9B920/G10DF6LT/en-US?type=<%@ include view='ExitSurvey' %></A>

 

This way i am getting error in personlization block.