This topic provides the list of attributes supported for each profile.

Current Customer (currentCustomer)

This profile consists of attributes related to fetching customer's profile information and loyalty details as listed in the table below. Use this profile to execute actions based on loyalty information and profile details of customers when they make transactions. 


ATTRIBUTEDESCRIPTIONSUB ATTRIBUTES
nameCustomer's full nameNA
firstnameCustomer's first nameNA 
lastnameCustomer's last nameNA 
avgBasketSizeThe ratio of total items purchased to the number of transactions of a customerNA 
avgSpendPerVisitAverage purchases amount of a customer per visitNA
clusterValueIncludes()To check customers of a particular cluster (segment)clusterValueIncludes(String clusterName, String clusterValue) 
clusterValueExcludes()To check customers who are not part of a particular clusterclusterValueExcludes(String clusterName, String clusterValue) 
currentPointsAvailable loyalty points of the customerNA 
customFieldValueExcludes()Customer custom field excludes the given valuecustomFieldValueExcludes("Field","Value") 
customFieldValueIncludes()Customer custom field includes the given valuecustomFieldValueIncludes("Field","Value") 
emailCustomer's email idNA 
externalIdCustomer's external idNA 
initialCurrentPointsActive points of a customer before evaluating the eventNA
initialLifetimePointsTotal loyalty points earned by a customer before evaluating the eventNA 
initialSlabNameCustomer's tier name before evaluating the eventNA 
initialSlabNumberCustomer's tier number before evaluating the eventNA 
joinDate Registration date of a customerdateDiff, day, dayOfMonth, daysDiff, daysDiffFromString, isAfter, isHourBetween, isTimeBetween, isValid, isWeekday, isWeekend, month, and year
For examples on using date formats, see the Date Format section on 
Using Operators in Rule Expressions
lifetimePoints Total points earned by a customer from the date of registrationNA 
lifetimePurchasesTotal purchases amount of a loyalty customer from the date of registrationNA 
mobileMobile number of a customerNA 
numberOfTxnsTotal number of transactions made by a customer from the date of registrationNA 
numberOfTxnsTodayNumber of transactions made by a customer the current dayNA 
numberOfVisitsTotal number of times a loyalty customer  visited your stores (made transactions in different days) 
NA 
SlabNameName of the current loyalty tier of a customerNA 
SlabNumberSerial number of the current tierNA 
isLoyalChecks if the current customer is registered in the brand's loyalty programExample: currentCustomer.isLoyal==true
hasInstoreProfile
Checks if the current customer has InStore profileExample: currentCustomer.hasInstoreProfile==true
hasWeChatProfile
Checks if the current customer has WeChat profile
Example: currentCustomer.hasWeChatProfile==true
doesProfileExists
Checks if a specific profile 


Current Transaction (currentTxn)

The currentTxn profile returns the details of a transaction. Use this profile to write rules on transactions, basket size, custom fields, and so on. Refer to the table below for all the supported attributes of customerTxn.


ATTRIBUTE

DESCRIPTION

 SUB ATTRIBUTES
numberTransaction number of the current transactioncontains, exists, isEmpty, isNotNull, isNull, isValidDate, matches, and notExists
basketSum()Sum of value of the items matching the inventory attributecurrentTxn.basketSum("Attribute Name","Inventory Value")
basketSumRegex()Sum of value of the items matching the inventory attribute - regular expressioncurrentTxn.basketSumRegex("Attribute Name","Attribute  Regex") 
basketQty()Total quantity of items in the bill matching the inventory. For instance, if 2 items of a given line-item are bought, then the basket quantity is 2.
currentTxn.basketQty("Attribute Name","Attribute Value")
basketQtyRegex()Quantity of items in the bill matching the regular expressioncurrentTxn.basketIncludes("Jeans","Levis002") 
basketCount()Number of products in the transaction of the given inventory type - irrespective of quantityEither pass just value or attribute and value pair. 
Example: currentTxn.basketCount("Dvs_flag","DVS_Flag")>1
basketCountRegex()Number of products whose item attribute matches the given regular expressionPass attribute and regex of the attribute that you want to validate
currentTxn.basketSum("Inventory Attribute","Regex")
 
basketIncludes()Products contained in the transaction.Pass attribute and value pair.
currentTxn.basketIncludes("Attribute Name","Attribute Value")
Example:
currentTxn.basketIncludes("Jeans","Levis002")
basketExcludes()Products not contained in the transactionPass attribute and value pair. 
currentTxn.basketExcludes("Attribute Name","Attribute Value")
Example:
currentTxn.basketExcludes("Jeans","Levis002")
basketIncludesRegex()If the bill includes products whose item attribute does not match the given regular expressionPass attribute and value pair. 
currentTxn.basketIncludesRegex("Attribute Name","Attribute Regex")
Example:
currentTxn.basketIncludes("Jeans","XXX") 
basketExcludesRegex()If the bill does not include products whose item attribute does not match the given regular expressionPass attribute and value pair. 
currentTxn.basketExcludesRegex("Attribute Name","Attribute Regex")
Example:
currentTxn.basketExcludes("Jeans","XXX") 
basketSizeTotal number of items in the bill - irrespective of quantity of each itemNA        
customFieldValueExcludesTransaction custom field excludes the given valueMention the custom field value that you want to validate as shown below
currentCustomer.customFieldValueExcludes("a_customertype","Loyalty") 
customFieldValueIncludes()Check if customer's transaction level custom field value includes the given valueMention the custom field value that you want to validate as shown below
customFieldValueIncludes("Field","Value")
Example:
currentCustomer.customFieldValueIncludes("a_customertype","Loyalty")
dateDate of transactiondateDiff, day, dayOfMonth, daysDiff, daysDiffFromString, isAfter, isHourBetween, isTimeBetween, isValid, isWeekday, isWeekend, month, and year
discountDiscount availed for a transaction NA
pointsTotal points issued for a transaction NA
totalQtyTotal quantity of all items in a transaction. For instance, if 2 items of a given line item are bought, then the 2 is added to the basket quantity. NA
 valueTotal value of the transaction interval
 notesTransaction level notes specified by the cashier during transactioncontains, exists, isEmpty, isNotNull, isNull, isValidDate, matches, and notExists

Current Event (currentEvent)

The current event profile returns the event that is triggered by event listener, i.e., the event on which the rule is created. The following table consists of the descriptions all the attributes of currentEvent.


ATTRIBUTE
DESCRIPTION
 SUB ATTRIBUTES
eventTypeName of the eventNA
Example:
currentEvent.eventType=="TransactionAdd" 
previousCustomFieldValue()Value of custom field before updatingcurrentEvent.previousCustomFieldValue("Custom Field Name","Field Value")
Example:
currentEvent.previousCustomFieldValue("age_group","value")

currentCustomFieldValue()Value of custom field after updatingcurrentEvent.currentCustomFieldValue("Custom Field Name","Field Value")
Example:
currentEvent.currentCustomFieldValue("age_group","value") 
previousMobileCustomer's mobile number before updatingNA 
previousEmailCustomer's email ID before updatingNA 
previousExternalIDCustomer's external ID before updatingNA 
previousNameCustomer's full name before updatingNA 
previousFirstNameCustomer's first name before updatingNA 
previousLastNameCustomer's last name before updatingNA 
currentMobileCustomer's mobile number after updatingNA 
currentEmailCustomer's email id after updatingNA 
currentExternalIDCustomer's external id after updatingNA 
currentNameCustomer's full name after updatingNA 
currentFirstNameCustomer's first name after updatingNA 
currentLastNameCustomer's last name after updating NA 
previousLoyaltyTypeChecks the loyalty status of the customer before the current event. Supported only for CustomerUpdate eventValues: LOYALTY/NON_LOYALTY
Example:
currentEvent.previousLoyaltyType=="LOYALTY" or currentEvent.previousLoyaltyType=="NON_LOYALTY"
previousLoyaltyType
Checks the current loyalty status of the customer. Supported only for CustomerUpdate event
Values: LOYALTY/NON_LOYALTY


Current Line Item (currentLineItem)

The currentLineItem profile returns line-items of a current transaction. You can use this profile only on forward cases and when transaction unroll is enabled. Use this profile to check line-item level details of the current transaction as provided in the table below.

ATTRIBUTE
DESCRIPTION
  SUB ATTRIBUTE
codeItem code of the line-item as assigned in the inventoryNA 
descriptionThe description specified for the of the line-item in the inventoryNA
currentLineItem.description=="<Item Description>" 
discountPercentageDiscount percentage at line-item levelNA 
doesItemMatch() Check if an item code matches with the given codedoesItemMatch("<Attribute Name>","<Value>") 
qty Quantity of a line-item purchasedNA 
rateActual price of a line-itemNA 
valueSelling price of a line-item NA

Return Bill (returnBill)

The returnBill profile is used to of a current transaction. You can use this profile only on forward cases and when transaction unroll is enabled. Use this profile to check line-item level details of the current transaction as provided in the table below.

ATTRIBUTE
DESCRIPTION
  SUB ATTRIBUTES
basketCountNumber of products in the transaction of the given inventory type - irrespective of quantity NA
basketCountRegex()Number of products whose item attribute matches the given regular expressionreturnBill.basketCountRegex("Inventory Attribute","Regex") 
basketCountRegexBrandNumber of products whose brand name matches the given regular expression
returnBill.basketCountRegexBrand("Brand Name","Regex") 
basketCountRegexCategoryNumber of products whose category name matches the given regular expression
returnBill.basketCountRegexCategory("Category Name","Regex") 
basketExcludes()Products not contained in the transactionExample:
returnBill.basketExcludes("MkmMakeCode","M0081")
basketIncludes()Products contained in the transactionExample:
returnBill.basketIncludes("MkmMakeCode","M0081") 
basketExcludesRegex()To check if the transaction includes products whose item attribute does not match the given regular expression
Example:
returnBill.basketExcludesRegex("MC","KI_AC.*")
basketIncludesRegex()To check if the transaction includes products whose item attribute matches the given regular expressionExample:
returnBill.basketIncludesRegex("MC","KI_AP.*")
basketIncludesRegexBrand()To check whether the transaction contains items of a specific brand returnBill.basketIncludesRegexBrand("Brand Regex")
returnBill.basketIncludesRegexBrand("LS")
 
basketIncludesRegexCategory()To check whether the transaction contains items of a specific categoryreturnBill.basketIncludesRegexCategory("Category Regex") 
basketQty() To check number of items in a transaction returnBill.basketQty("Attribute Name","Attribute Value") 
basketQtyRegex() Quantity of items in the bill matching the regular expression returnBill.basketQty("Attribute Name","Attribute Value")  
basketQtyRegexBrand() Number of quantities of a specific item whose brand name matches the given regular expressionreturnBill.basketQtyRegexBrand("Brand Name","Regex")   
basketQtyRegexCategory() Number of quantities of a specific item whose category name matches the given regular expression returnBill.basketQtyRegexCategory("Category Name","Regex")
basketSize Total number of items in the bill - irrespective of quantity of each item  NA
basketSum()Sum of value of the items matching the inventory attribute Example:
returnBill.basketSum("Product","Shirt")
basketSumRegex()Sum of value of the items matching the inventory attribute - regular expression Example:
returnBill.basketSum("Product","Regex")
customFieldValueExcludes()Transaction custom field excludes the given value Pass the custom field value that you want to validate as shown below
customFieldValueExcludes("Field","Value")
Example:
returnBill.customFieldValueExcludes("a_customertype","Loyalty") 
customFieldValueIncludes() Check if customer's transaction level custom field value includes the given value Pass the custom field value that you want to validate as shown below
customFieldValueIncludes("Field","Value")
Example:
returnBill.customFieldValueIncludes("a_customertype","Loyalty") 
date Date of transaction
dateDiff, day, dayOfMonth, daysDiff, daysDiffFromString, isAfter, isHourBetween, isTimeBetween, isValid, isWeekday, isWeekend, month, and year 
For examples on using date formats, see the Date Format section on Using Operators in Rule Expressions
discount Discount availed for a transaction  NA
notesTransaction level notes specified by the cashier during transaction contains, exists, isEmpty, isNotNull , isNull , isValidDate, matches, and notExists 
numberTransaction number of the current transaction contains, exists, isEmpty, isNotNull, isNull, isValidDate, matches, and notExists 
points Total points issued for a transaction NA
totalQty Date of transactionNA 

Current Store (currentStore)

The currentStore profile is used to check store level details. You can write rules based on the attributes provided in the table below. 


ATTRIBUTE

 DESCRIPTION

 SUB ATTRIBUTES

codeUnique code of the store NA
nameName of the store NA

Tender Profile (tenderProfile)

This tenderProfile is used to write rules based on the payment mode combinations.


ATTRIBUTE
DESCRIPTION
  SUB ATTRIBUTES
amountThe amount paid for a transaction using payment mode NA
codeReturns code or name of the combination created in loyalty for the payment modecontains, exists, isEmpty, isNotNull, isNull, isValidDate, matches and notExists
notes Returns notes described for the tendercontains, exists, isEmpty, isNotNull , isNull , isValidDate, matches, and notExists