Expand my Community achievements bar.

Read Javascript variables in Delivery

Avatar

Level 2

Hi All,

 

Hope You are doing great !

 

I am trying to display a list of campaigns executed in a day. For this I created an HTML table to show the campaign labels, delivery labels, Success counts etc. As shown in the screenshot, my workflow includes activities where I fetch data from the delivery schema, alias the required fields in the "Final Data" named enrichment activity, and then used JavaScript to retrieve these fields. I then apply a query activity with the Recipient schema to define the target audience. While the alert activity works fine after the JavaScript step, placing a delivery activity after the Recipient query causes the delivery to fail.

 

Could you suggest a solution for this issue?

 

WF -

Neelam1991_0-1735138789981.png

 

JS Used -

 

var query = xtk.queryDef.create (

<queryDef schema= "temp:enrich22" operation="select">

<select>

<node expr="contact_date"/>
<node expr="country"/>
<node expr="delivery_label"/>
<node expr="msg_to_send"/>
<node expr="success"/>
<node expr="unique_open"/>
<node expr="unique_clicks"/>
</select>

<orderBy >
<node expr="country" sortDesc="true"/>

</orderBy >

</queryDef>)

var itemsXML = query.ExecuteQuery();
instance.vars.itemsXMLString = itemsXML.toXMLString();

 

HTML :

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<style>
table {
width: 100%;
border-collapse: collapse;
}

th, td {
text-align: left;
padding: 8px;
}

th {
background-color: #dddddd;
}

@media (max-width: 600px) {
table {
display: block;
overflow-x: auto;
white-space: nowrap;
}

td {
display: inline-block;

}

td:before {
content: attr(data-label);
float: left;
font-weight: bold;
text-transform: uppercase;
}
}

@media (min-width: 601px) {
table {
display: table;
}

td:before {
content: "";
display: none;
}
}

</style>

</HEAD>

<BODY>

<CENTER><H1>Daily communications deployed > </H1></CENTER>

<table border=1 style="width:100%" id="Main_Table">
<tr>
<td colspan =9>
<center><img width="380" height="95" src=""></img></center>
</td>
</tr>
<tr>
<th>Contact Date</th>
<th>Country</th>
<th>Delivery Label</th>
<th>Message to Send</th>
<th>Success</th>
<th>Unique Open</th>
<th>Unique Clicks</th>
</tr>
<%

var itemsXML = new XML(vars.itemsXMLString)
for each (var item in itemsXML){

%>

<tr>
<td data-label="Contact Date"><%= item.contact_date %></td>
<td data-label="Country"><%= item.country %></td>
<td data-label="Delivery Label"><%= item.delivery_label %></td>
<td data-label="Message to Send"><%= item.msg_to_send %></td>
<td data-label="Success"><%= item.success %></td>
<td data-label="Unique Open"><%= item.unique_open %></td>
<td data-label="Unique Clicks"><%= item.unique_clicks %></td>
</tr>
<%
}
%>
</table>
</BODY>
</HTML>

 

@Amit_Kumar

@Marcel_Szimonisz 

@Jean-Serge_Biro 

@Vipul_Raghav 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

2 Replies