Expand my Community achievements bar.

SOLVED

how to get @recipientClick from nms:delivery table

Avatar

Level 2

i am trying to do this:

 

const queryDef = {
schema: "nms:delivery",
operation: "select",
select: {
node: [
{ expr: "@recipientClick" }
]
}
 
};
const query = NLWS.xtkQueryDef.create(queryDef);
const mappings = await query.executeQuery();
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

hi @arnav21 ,

You can get recipients click using  expr= "[indicators/@recipientClick]" 

Example,

var query = xtk.queryDef.create(
  <queryDef schema="nms:delivery" operation="select" >    
    <select>
      <node expr= "@id" />
      <node expr= "[indicators/@recipientClick]" />          
    </select>
    <where>  
       <condition expr="@id = 12345"/>
    </where>    
   </queryDef>
)
var result = query.ExecuteQuery();
for each (var output in result.delivery)  
{
vars.id = output.@id;
vars.recipientClick = output.indicators.@recipientClick; 
logInfo("id : " + vars.id);
logInfo("recipientClick : " + vars.recipientClick);
}

  

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

hi @arnav21 ,

You can get recipients click using  expr= "[indicators/@recipientClick]" 

Example,

var query = xtk.queryDef.create(
  <queryDef schema="nms:delivery" operation="select" >    
    <select>
      <node expr= "@id" />
      <node expr= "[indicators/@recipientClick]" />          
    </select>
    <where>  
       <condition expr="@id = 12345"/>
    </where>    
   </queryDef>
)
var result = query.ExecuteQuery();
for each (var output in result.delivery)  
{
vars.id = output.@id;
vars.recipientClick = output.indicators.@recipientClick; 
logInfo("id : " + vars.id);
logInfo("recipientClick : " + vars.recipientClick);
}