compute label name | Community
Skip to main content
Level 4
December 8, 2017
Solved

compute label name

  • December 8, 2017
  • 11 replies
  • 6168 views

HI

I am trying to generate a computed label on the delivery templates so that I can have generic name on the campaign deliveries( under Analysis tab) I have many deliveries so I dont want to have many campaign templates. for somehow when I enter a script i get an error when I include a conditional statement. Any Idea why is not working?

Welcome <% if (<%= recipient.productCode %>== "101") { %> camp1<% } %>

JST-310000 Error while compiling script 'delivery name' line 4: illegal XML character

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jean-Serge_Biro

No, you can get values from your specific schema, but it should come from a 1-1 or N-1 relationship  (blue one) not from a 1-N relationship (yellow one) because otherwise how can you select the exact value between many records linked to your delivery ?
If you select a yellow relationship, AC takes randomly one record of the linked dimension.

11 replies

florentlb
Level 10
December 8, 2017

Hi Vendim,

Can you share the whole script so we can take a look at it?

I'm not sure of what the best practices are in this case.

Florent

Level 4
December 8, 2017

Hi Florent

thats the whole script. based on the value of that field I need to set the the delivery label name

I tried this both and it looks like doesnt recocnize the recipient at that level.( see below)

Welcome <% if (<%= recipient.productCode %>== "101") { %> camp1<% } %>

Welcome <%if(<%= recipient.firstName %> == "abc") { %> camp1<% }<% else { %>Test<% } %>

Jean-Serge_Biro
Level 10
December 8, 2017

Hi Vendim,

It seems you put too much <% %>. Try this:

Welcome <% if (recipient.productCode == "101") { %> camp1<% } %>

and bad enclosing logic, try this:

Welcome <%if(recipient.firstName == "abc") { %> camp1<% } else { %>Test<% } %>

Regards
JS

Level 4
December 8, 2017

HI JS

I have tried that It doesn't help. I get JST-310000 Error While compiling script 'delivery name' line 4: recipient is not defined

Welcome <%if(recipient.firstName == "abc") { %> camp1<% } else { %>Test<% } %>

Level 4
December 8, 2017

here is the full error that I get

Jean-Serge_Biro
Level 10
December 8, 2017

yes of course, I forgot to mention it.

I guess you are misleading the label name of the delivery and the object of the mail, aren't you?

In the delivery properties tab,  you are at the delivery level. So it is common to all recipients targeted. It is the label name of the delivery, not the object of a specific message sent to a specific recipient...

So even if you want to put a valuable syntax such as:

<%= delivery.broadLogRcp.recipient.email %>

it would take one of the recipient of the 0,n relationship, by chance, which is not obviously what you meant to do.

Calculation delivery label name is for automating naming such as inserting month in the delivery label name from a model delivery.

Regards
JS

Level 4
December 8, 2017

thanks JS for the Quick response

yes I am trying for the automation of the naming of deliveries

so since I have many deliveries that are common but I want to identify them on some characteristics that why I can trying to get that based on the product number( the recipient was to test if was able to get the name ) .

so you saying I cannot get a value from a specific schema there right? can I do with variables? Options?

Practially I was trying to give the workflow name based on their product that they belong too.

thanks

Jean-Serge_Biro
Jean-Serge_BiroAccepted solution
Level 10
December 8, 2017

No, you can get values from your specific schema, but it should come from a 1-1 or N-1 relationship  (blue one) not from a 1-N relationship (yellow one) because otherwise how can you select the exact value between many records linked to your delivery ?
If you select a yellow relationship, AC takes randomly one record of the linked dimension.

Level 4
December 8, 2017

This make much more sense. So at that level am I limited to only the objects( Schemas) that are listed there or I can build my custom schema ( N-1) or 1-1 and use that my look up for applying the logic on the statement?

Thanks again

Jean-Serge_Biro
Level 10
December 11, 2017

Hi Vendim,

Yes you can.

Regards
JS