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 log into journal and store open ratio of deliveries using javascript

Avatar

Avatar
Validate 1
Level 2
akashaj7696
Level 2

Likes

5 likes

Total Posts

29 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 3
View profile

Avatar
Validate 1
Level 2
akashaj7696
Level 2

Likes

5 likes

Total Posts

29 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 3
View profile
akashaj7696
Level 2

09-03-2021

Hi Everyone,

 

I'm facing an issue in displaying and storing the value of open ratio using JavaScript. I have used the below code, please let me know where i'm wrong.

 

// query the database to find the winner (best open rate)
var winner = xtk.queryDef.create(
<queryDef schema="nms:delivery" operation="get">
<select>
<node expr="@id"/>
<node expr="@label"/>
<node expr="@internalName"/>;
<node expr="[@operation-id]" alias="operationId2"/>
<node expr="[indicators/@estimatedRecipientOpenRatio]" alias="ratio"/>
<node expr="[indicators/@totalRecipientOpen]" alias="estimated"/>;
</select>
<where>
<condition expr="@internalName='DM187125'"/>
</where>
</queryDef>).ExecuteQuery();

for each (var w in winner){
vars.ratio = w.@ratio;
logInfo("The value of open ratio is " +vars.ratio); - This displays blank.
logInfo(winner); - This displays all the values in the journal.
}

Any help would be appreciated.

 

Thanks,

Akash

View Entire Topic

Avatar

Avatar
Validate 1
MVP
_Manoj_Kumar
MVP

Likes

104 likes

Total Posts

301 posts

Correct Reply

97 solutions
Top badges earned
Validate 1
Contributor
Ignite 1
Shape 1
Give Back 5
View profile

Avatar
Validate 1
MVP
_Manoj_Kumar
MVP

Likes

104 likes

Total Posts

301 posts

Correct Reply

97 solutions
Top badges earned
Validate 1
Contributor
Ignite 1
Shape 1
Give Back 5
View profile
_Manoj_Kumar
MVP

13-03-2021

@akashaj7696 

 

Try this:

 

logInfo("The value of open ratio is " +""+vars.ratio+"");