Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
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
Community Advisor

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
Community Advisor

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

Community Advisor

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!



Sukrity Wadhwa