Expand my Community achievements bar.

SOLVED

workflow question: multiple variables from JS node into email template

Avatar

Level 8

I am using Campaign V8 client console.

My workflow looks like this:

Michael_Soprano_0-1723580785066.png

 

As an output of JS node in workflow I have these variables - I assume that these become workflow variables:

instance.vars.x1 = price1;
instance.vars.x2 = name1;
instance.vars.x3 = image1;

 

In the delivery script node I put something like this:

Michael_Soprano_1-1723580887296.png

Then I would like to use them in the template. More or less like this: 

Michael_Soprano_2-1723581217286.png

Could you tell me why its not working? 

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 4

It's actually an annoyingly obtuse process! You need to define a variable in the properties section, then assign the instance.vars.XXXX variable to it in the initialisation script section. 

I wrote a quick guide here:
https://alexlangridge.com/adobe-campaign--use-defined-variables-in-an-email

View solution in original post

3 Replies

Avatar

Correct answer by
Level 4

It's actually an annoyingly obtuse process! You need to define a variable in the properties section, then assign the instance.vars.XXXX variable to it in the initialisation script section. 

I wrote a quick guide here:
https://alexlangridge.com/adobe-campaign--use-defined-variables-in-an-email

Avatar

Level 8

Thanks a lot!

Do you know how to dynamically change the source of the photo in html email template like that?

Michael_Soprano_0-1723623224043.png

 

Avatar

Level 4

Hmm! Just checking, you may need to amend the delivery script node, because it's zero indexed. 

delivery.variables._var[0].stringValue would correspond to the FIRST variable you've set up in the properties > variables section.

ALangridge_1-1723680848561.png

 

In my example, 

delivery.variables._var[0].stringValue would be for mobileExistsCount,

delivery.variables._var[1].stringValue for validityCheckFail

and delivery.variables._var[2].stringValue for validityCheckPass