How to insert a VARS inside a delivery template

Avatar

Avatar
Validate 25
Level 4
salvdangelo
Level 4

Likes

45 likes

Total Posts

130 posts

Correct reply

4 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile

Avatar
Validate 25
Level 4
salvdangelo
Level 4

Likes

45 likes

Total Posts

130 posts

Correct reply

4 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
salvdangelo
Level 4

13-02-2018

Hi,

This might be a simple question for most of you.

I am not able to use a global variable like this 'vars.productName' that I retrieved through a signal (SOAP request) in a delivery template.

The problem is that if a put it inside a delivery template (this one below is just an example)

<html>...

     <body>

     ...

     <%= vars.productName %>

     </body>

</html>

I will always get this error
Error while compiling script 'content htmlContent' line 4: vars is not defined. SCR-160012 JavaScript: error while evaluating script 'content htmlContent'.


Note that vars.product is not empty and I can read it with a logInfo() function.

Do you have any idea on the resolution of this issue?

Thanks for your precious help!

Salvatore

Jean-Serge Biron

inactiveforumnotifier

Amy_Wong

Woojin

clawson

mghalpin

David_Powers

Adobe Campaign

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

14-02-2018

Hi Salvatore,

As described in many tickets about passing variables from/to delivery template/workflow, you can use the Variables tab of Deliveries, and/or manage the syntax in the Javascript:

delivery.variables._var[0].stringValue = vars.productName;

Regards.
JS

Answers (0)