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

SOLVED

How to get the value of the variable obtained by JS in the body of the Recurring delivery.

Avatar

Level 2

Hello.

 

I want to know, How to get the value of the variable obtained by JS in the body of the Recurring delivery.

For example, get the date. It into the Email body.

Email is a Text Email.

It is not a HTML Email.

 

JS

instance.vars.yearTest = formatDate (new Date(), "%Y")

logInfoz("yearTest = [" + instance.vars.yearTest + "]");

 

Recurring delivery

<%= $(instance/vars/@yearTest) &>

 

This will give an XFR-180000 error.

I don't think I understand correctly...

 

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 7

Hi @uz2020 ,

Step 1: Right click recurring delivery > open > in script tab add this below code

delivery.variables._var[0].stringValue=instance.vars.yearTest;

script tab.PNG

 

Step 2: In delivery property 'Variable' tab, Add > Define Name and dataType alone 

(for eg, Name = yearTest and Data type = Text) and save the delivery.

variable tab.PNG

Step 3: Go to your text content tab, you can select your variable as shown below,

Text content.PNG 

 

Regards,

ParthaSarathy S

View solution in original post

6 Replies

Avatar

Correct answer by
Level 7

Hi @uz2020 ,

Step 1: Right click recurring delivery > open > in script tab add this below code

delivery.variables._var[0].stringValue=instance.vars.yearTest;

script tab.PNG

 

Step 2: In delivery property 'Variable' tab, Add > Define Name and dataType alone 

(for eg, Name = yearTest and Data type = Text) and save the delivery.

variable tab.PNG

Step 3: Go to your text content tab, you can select your variable as shown below,

Text content.PNG 

 

Regards,

ParthaSarathy S

Avatar

Level 2
Hello, @ParthaSarathy , Thanks for your quick reply! Thanks to you, I understand how to read variables. But the XFR-180000 error is still not resolved. I have confirmed the operation with the following simple set. Start-> JS -> Recurring delivery Do I need to other setting Adobe Campaign? Thanks.

Avatar

Level 7

Hi @uz2020 ,

In which activity you are getting this error? In Recurring delivery call your variable as I had mentioned above, and not in this format <%= $(instance/vars/@yearTest) &>.

Avatar

Level 2
Hello, @ParthaSarathy , Thank you for your reply again! The error is occurring in Recurring delivery. I'm using 'Variable' format. I duplicated and used an existing Recurring delivery. That may be the cause. I create a new Recurring delivery and try it. Thanks!

Avatar

Level 2
@ParthaSarathy Hello, I haven't solved it yet, but the cause of the error seems to be the lack of target mapping. Thank you for your help!

Avatar

Administrator

Hi @uz2020,

Were you able to resolve this query or do you still need more help here? Do let us know.

Thanks!