Quantcast
Viewing latest article 18
Browse Latest Browse All 86399

Re: Sorting data from table in HTML

Hi Emily,

 

this may be helpful for you (query and table template) as example.

Just change fields in the incoming transition according to your workflow  and field which will be used for sorting.

 

var query = NLWS.xtkQueryDef.create({queryDef: {

  schema: vars.targetSchema, operation: "select",

  select: { node: [

    {expr: "@internalName"},

    {expr: "@label"},

    {expr: "@folderLabel"},

    {expr: "@lastStart"},

    {expr: "@name"},

  ]},

  orderBy: { node: [{expr:"@label", sortDesc:"true"}] }

}});

var records = query.ExecuteQuery();

 

 

vars.htmlEmail = '';

vars.htmlEmail += '<table border="1"><thead>';

vars.htmlEmail += '<tr><th>internalName</th><th>Label</th><th>Last Start</th><th>Folder</th><th>Name</th></tr>';

vars.htmlEmail += '</thead><tbody>';

for each(var record in records.getElements()){

  vars.htmlEmail += '<tr>';

  vars.htmlEmail += '<td>'+record.$internalName+'</td>';

  vars.htmlEmail += '<td>'+record.$label+'</td>';

  vars.htmlEmail += '<td>'+record.$lastStart+'</td>';

  vars.htmlEmail += '<td>'+record.$folderLabel+'</td>';

  vars.htmlEmail += '<td>'+record.$name+'</td>';

  vars.htmlEmail += '</tr>';

}

vars.htmlEmail += '</tbody></table>';

 

Regards,

Milan

Image may be NSFW.
Clik here to view.

Viewing latest article 18
Browse Latest Browse All 86399

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>