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 to get the value of the variable obtained by JS in the body of the Recurring delivery.

Avatar

Avatar
Validate 1
Level 1
uz2020
Level 1

Likes

0 likes

Total Posts

32 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
uz2020
Level 1

Likes

0 likes

Total Posts

32 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
uz2020
Level 1

20-01-2021

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.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back
Level 4
ParthaSarathy
Level 4

Likes

34 likes

Total Posts

59 posts

Correct Reply

26 solutions
Top badges earned
Give Back
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Give Back
Level 4
ParthaSarathy
Level 4

Likes

34 likes

Total Posts

59 posts

Correct Reply

26 solutions
Top badges earned
Give Back
Boost 5
Boost 3
Boost 25
Boost 10
View profile
ParthaSarathy
Level 4

20-01-2021

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

Answers (1)

Answers (1)

Avatar

Avatar
Validate 500
Employee
Sukrity_Wadhwa
Employee

Likes

133 likes

Total Posts

806 posts

Correct Reply

35 solutions
Top badges earned
Validate 500
Validate 250
Validate 100
Validate 25
Validate 50
View profile

Avatar
Validate 500
Employee
Sukrity_Wadhwa
Employee

Likes

133 likes

Total Posts

806 posts

Correct Reply

35 solutions
Top badges earned
Validate 500
Validate 250
Validate 100
Validate 25
Validate 50
View profile
Sukrity_Wadhwa
Employee

27-01-2021

Hi @uz2020,

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

Thanks!