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.
ATTRIBUTE | DESCRIPTION | SUB ATTRIBUTES |
name | Customer's full name | NA |
firstname | Customer's first name | NA |
lastname | Customer's last name | NA |
avgBasketSize | The ratio of total items purchased to the number of transactions of a customer | NA |
avgSpendPerVisit | Average purchases amount of a customer per visit | NA |
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 cluster | clusterValueExcludes(String clusterName, String clusterValue) |
currentPoints | Available loyalty points of the customer | NA |
customFieldValueExcludes() | Customer custom field excludes the given value | customFieldValueExcludes("Field","Value") |
customFieldValueIncludes() | Customer custom field includes the given value | customFieldValueIncludes("Field","Value") |
Customer's email id | NA | |
externalId | Customer's external id | NA |
initialCurrentPoints | Active points of a customer before evaluating the event | NA |
initialLifetimePoints | Total loyalty points earned by a customer before evaluating the event | NA |
initialSlabName | Customer's tier name before evaluating the event | NA |
initialSlabNumber | Customer's tier number before evaluating the event | NA |
joinDate | Registration date of a customer | 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 |
lifetimePoints | Total points earned by a customer from the date of registration | NA |
lifetimePurchases | Total purchases amount of a loyalty customer from the date of registration | NA |
mobile | Mobile number of a customer | NA |
numberOfTxns | Total number of transactions made by a customer from the date of registration | NA |
numberOfTxnsToday | Number of transactions made by a customer the current day | NA |
numberOfVisits | Total number of times a loyalty customer visited your stores (made transactions in different days) | NA |
SlabName | Name of the current loyalty tier of a customer | NA |
SlabNumber | Serial number of the current tier | NA |
isLoyal | Checks if the current customer is registered in the brand's loyalty program | Example: currentCustomer.isLoyal==true |
hasInstoreProfile | Checks if the current customer has InStore profile | Example: 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 |
number | Transaction number of the current transaction | contains, exists, isEmpty, isNotNull, isNull, isValidDate, matches, and notExists |
basketSum() | Sum of value of the items matching the inventory attribute | currentTxn.basketSum("Attribute Name","Inventory Value") |
basketSumRegex() | Sum of value of the items matching the inventory attribute - regular expression | currentTxn.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 expression | currentTxn.basketIncludes("Jeans","Levis002") |
basketCount() | Number of products in the transaction of the given inventory type - irrespective of quantity | Either 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 expression | Pass 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 transaction | Pass 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 expression | Pass 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 expression | Pass attribute and value pair. currentTxn.basketExcludesRegex("Attribute Name","Attribute Regex") Example: currentTxn.basketExcludes("Jeans","XXX") |
basketSize | Total number of items in the bill - irrespective of quantity of each item | NA |
customFieldValueExcludes | Transaction custom field excludes the given value | Mention 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 value | Mention the custom field value that you want to validate as shown below customFieldValueIncludes("Field","Value") Example: currentCustomer.customFieldValueIncludes("a_customertype","Loyalty") |
date | Date of transaction | dateDiff, day, dayOfMonth, daysDiff, daysDiffFromString, isAfter, isHourBetween, isTimeBetween, isValid, isWeekday, isWeekend, month, and year |
discount | Discount availed for a transaction | NA |
points | Total points issued for a transaction | NA |
totalQty | Total 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 |
value | Total value of the transaction | interval |
notes | Transaction level notes specified by the cashier during transaction | contains, 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 |
eventType | Name of the event | NA Example: currentEvent.eventType=="TransactionAdd" |
previousCustomFieldValue() | Value of custom field before updating | currentEvent.previousCustomFieldValue("Custom Field Name","Field Value") Example: currentEvent.previousCustomFieldValue("age_group","value") |
currentCustomFieldValue() | Value of custom field after updating | currentEvent.currentCustomFieldValue("Custom Field Name","Field Value") Example: currentEvent.currentCustomFieldValue("age_group","value") |
previousMobile | Customer's mobile number before updating | NA |
previousEmail | Customer's email ID before updating | NA |
previousExternalID | Customer's external ID before updating | NA |
previousName | Customer's full name before updating | NA |
previousFirstName | Customer's first name before updating | NA |
previousLastName | Customer's last name before updating | NA |
currentMobile | Customer's mobile number after updating | NA |
currentEmail | Customer's email id after updating | NA |
currentExternalID | Customer's external id after updating | NA |
currentName | Customer's full name after updating | NA |
currentFirstName | Customer's first name after updating | NA |
currentLastName | Customer's last name after updating | NA |
previousLoyaltyType | Checks the loyalty status of the customer before the current event. Supported only for CustomerUpdate event | Values: 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 |
code | Item code of the line-item as assigned in the inventory | NA |
description | The description specified for the of the line-item in the inventory | NA currentLineItem.description=="<Item Description>" |
discountPercentage | Discount percentage at line-item level | NA |
doesItemMatch() | Check if an item code matches with the given code | doesItemMatch("<Attribute Name>","<Value>") |
qty | Quantity of a line-item purchased | NA |
rate | Actual price of a line-item | NA |
value | Selling 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 |
basketCount | Number 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 expression | returnBill.basketCountRegex("Inventory Attribute","Regex") |
basketCountRegexBrand | Number of products whose brand name matches the given regular expression | returnBill.basketCountRegexBrand("Brand Name","Regex") |
basketCountRegexCategory | Number of products whose category name matches the given regular expression | returnBill.basketCountRegexCategory("Category Name","Regex") |
basketExcludes() | Products not contained in the transaction | Example: returnBill.basketExcludes("MkmMakeCode","M0081") |
basketIncludes() | Products contained in the transaction | Example: 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 expression | Example: 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 category | returnBill.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 expression | returnBill.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 |
notes | Transaction level notes specified by the cashier during transaction | contains, exists, isEmpty, isNotNull , isNull , isValidDate, matches, and notExists |
number | Transaction 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 transaction | NA |
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 |
code | Unique code of the store | NA |
name | Name of the store | NA |
Tender Profile (tenderProfile)
This tenderProfile is used to write rules based on the payment mode combinations.
ATTRIBUTE | DESCRIPTION | SUB ATTRIBUTES |
amount | The amount paid for a transaction using payment mode | NA |
code | Returns code or name of the combination created in loyalty for the payment mode | contains, exists, isEmpty, isNotNull, isNull, isValidDate, matches and notExists |
notes | Returns notes described for the tender | contains, exists, isEmpty, isNotNull , isNull , isValidDate, matches, and notExists |