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
Bedrock Mission!

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

AdrianHartNT
Level 1
Level 1

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,

0 Replies