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
BedrockMission!

Learn More

View all

Sign in to view all badges

How can I use a javascript script in a workflow to create variables to be used in an email delivery

Avatar

Avatar
Ignite 1
Level 1
AdrianHartNT
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

1 solution
Top badges earned
Ignite 1
Validate 1
Affirm 1
View profile

Avatar
Ignite 1
Level 1
AdrianHartNT
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

1 solution
Top badges earned
Ignite 1
Validate 1
Affirm 1
View profile
AdrianHartNT
Level 1

11-03-2016

I'd like to create a new variable which will be a copy of a target level variable, create a new variable which is a substring and then use the new variable in a delivery.

Something like:

var mainImageHeaderText_var = instance.currentOrder.localContent.singleProperty.mainImageHeaderText_A;

logInfo("mainImageHeaderText_var = "+mainImageHeaderText_var);

var vars.test = mainImageHeaderText_var.substring(mainImageHeaderText_var.indexOf("WSTART")+7, mainImageHeaderText_var.indexOf("WEND")-1));

The first line returns "undefined"

The reason I can't do this via an enrichment is that the string length may exceed 255 characters.

Thanks,