Expression Examples

Please note that the maximum character limit for Expressions is 500.

TypeExample

Has label

{                                                       
"operator": "expression",                             
"data": "agg(transaction.labels).matchLabel('k1')"    
}                                                                                             
                                                                              
{                                                       
"operator": "expression",                             
"data": "agg(customer.labels).matchLabel('k1', 'v1')" 
}    

Has item label

{                                                       
"operator": "expression",                             
"data": "transaction.itemLabel('k1').qty > 2"         
}    

Has item label with value

{                                                       
"operator": "expression",                             
"data": "transaction.itemLabel('k1', 'v1').qty > 2"         
}    

Sum by

{                                                       
"operator": "expression",                             
"data": "agg(transaction.items).sumBy('qty') > 2"     
}  

Transaction item by

{                                                       
"operator": "expression",                             
"data": "transaction.maker('Company').qty > 0         
}                                                       
                                                                                                                                                 
{                                                       
"operator": "expression",                             
"data": "transaction.category('C1').qty > 0           
}                                                       
                                                                                                                                                              
{                                                       
"operator": "expression",                             
"data": "transaction.sku('AB1122').qty > 0            
}               

Achievement progressed

{                                                       
"operator": "expression",                             
"data": "event.body.progressStatuses[0].currentPeriodValue >= 0"     
}  

Last updated