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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

The 4th edition of the Campaign Community Lens newsletter is out now!
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);
}