Profiles & attributes

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

Expressions on customer profile (currentCustomer)

This profile consists of attributes related to fetching customers' 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 ATTRIBUTESDESCRIPTIONSYNTAX AND EXAMPLEDETAILED DOCUMENTATION
nameCustomer's full name
Data Type : String
Meaning : Customer's full name
name = firstName + "" "" + lastName
NANASyntax: [currentCustomer.name == "customer full name"]
Example: currentCustomer.name == "Shreya Badia"
currentCustomer.name.contains("santhosh kumar")
Learn More
firstnameCustomer's first name
Data Type : String
Customer's first name
name = firstName
NANASyntax: [currentCustomer.name == "customer first name"]
Example: currentCustomer.firstname=="prakhar"
currentCustomer.firstname=="Raj"
currentCustomer.firstname.matches("santhosh")
Learn More
lastnameCustomer's last name
Data Type : String
Customer's last name
name = "" "" + lastName
NANASyntax: [currentCustomer.name == "customer Last name"]
currentCustomer.lastname=="verma"
currentCustomer.lastname.matches("kumar")
Learn More
avgBasketSizeData type : Int (Integer)
The ratio of total items purchased to the number of transactions of a customer basically on an average how many items are there in a customer's Cart. avgBasketSize = (Sum of total lineitems)/Number of Transaction (aka Count of transaction) or sum of (number of lineitems) in all bills / number of bill
NANASyntax: [currentCustomer.avgBasketSize (opeprators like <.>,==,>=,<=) Value]
Example: currentCustomer.avgBasketSize>1
Learn More
avgSpendPerVisitReturn Data Type: BigDecimal
Attribute Label: Avg. Spend per Visit
Meaning: Average purchases amount of a customer per visit.
AvgSpendPerVisit = lifetimePurchase / numberOfVisits
NANASyntax: [currentCustomer.avgSpendPerVisit(operators like <.>,==,>=,<=) Value ]
Example: currentCustomer.avgBasketSize==10&&(currentCustomer.avgSpendPerVisit==10)
Learn More
clusterValueIncludes()return data type: Boolean
Attribute Label: User Segment (cluster name)and sub-segments
Meaning: To check customers of a particular cluster (segment) aka checks If customer belongs to particular segment
clusterValueIncludes(String clusterName, String clusterValue)cluster Name: Name of the cluster and Sub Segment/cluster Value of the cluster where the current customer might belongs to.Syntax: currentCustomer.clusterValueIncludes("cluster name","cluster sub components")
Example : currentCustomer.clusterValueIncludes("Behavioral Segment","Adventure-seeker")
Learn More
clusterValueExcludes()return data type: Boolean
Attribute Label: User Segment
Meaning: To check customers who are not part of a particular cluster or returns False If the current customer is not a part of the cluster passed in the attribute and sub-attribute.
clusterValueExcludes(String clusterName, String clusterValue)cluster Name: Name of the cluster and Sub Segment/cluster Value of the cluster where the current customer might belongs to.Syntax: currentCustomer.clusterValueExcludes("cluster name","cluster sub components")
Example: currentCustomer.clusterValueExcludes("Behavioral Segment","Adventure-seeker")
Learn More
currentPointsData type: BigDecimal
Meaning: customer's current redeemable points.
current points = overall earned points - overall returned points - overall redeemed points - overall expired points
Values like isNull, isNotNull, Interval .isNull - checks if the value is Null i.e. the value was not passed from source isNotNull - checks if the the Value is NOT Null.Syntax: [currentCustomer.currentPoints (Operators like >,<, ==, >=, <= VALUE)]
Example : currentCustomer.currentPoints>500
Learn More
currentNonRedeemablePointsData type: BigDecimal
customer's current promised points
current promised points = overall earned points - overall returned points - overall expired points
Values like isNull, isNotNull, Interval .isNull - checks if the value is Null i.e. the value was not passed from source isNotNull - checks if the the Value is NOT Null.
customFieldValueExcludes()Data Type: Boolean
Meaning: Returns False If customer has some custom field present with particular value.
Example: currentCustomer.customFieldValueExcludes(""area"",""XYZ""), where area is a custom field and XYZ id one of the value of the Custom Field.
customFieldValueExcludes("Field","Value")
Sub-Attributes: Custom field name and Custom field value.
Custom Field Name: The name of the custom Field generated.
Custom Field Value: The value of the custom field passed as a sub-attribute.
currentCustomer.customFieldValueExcludes(String clusterName, String clusterValue)
Example: currentCustomer.customFieldValueExcludes("gender","Male")
Learn More
customFieldValueIncludes()Data Type: Boolean
Meaning: checks If customer has some custom field present with particular value.
Example:currentCustomer.customFieldValueIncludes(""area"",""XYZ""), where area is a custom field and XYZ id one of the value of the Custom Field.
customFieldValueIncludes("Field","Value")
Sub-Attributes: Custom field name and Custom field value.
Custom Field Name: The name of the custom Field generated.
Custom Field Value: The value of the custom field passed as a sub-attribute.
currentCustomer.customFieldValueIncludes(String clusterName, String clusterValue)
Example: currentCustomer.customFieldValueIncludes("gender","Male")
Learn More
emailData type: String
Meaning: Customer's email ID or checks which organization is in the email of Customer.
NANASyntax: currentCustomer.email.matched(""customer email id"") Or currentCustomer.email.contains(""@companyX.com"")
Example: currentCustomer.email.matches("[email protected]")
Learn More
externalIdData type: String
Customer's external id : Let's say to issue coupons to customers whose external ID contains a certain serial number (say 1234), use the following condition: customerCustomer.externalId.contains("1234")
NANASyntax: currentCustomer.externalId.matches("....")
currentCustomer.externalId.contains(".....")
Example: customerCustomer.externalId.contains("1234")
Learn More
initialCurrentPointsData Type: BigDecimal
Meaning: customer's current redeemable points before current event or Active points of a customer before evaluating the event
initial current points = overall earned points (before evaluating a event) - overall returned points(before evaluating a event) - overall redeemed points(before evaluating a event) - overall expired points(before evaluating a event)
NANASyntax: [currentCustomer.initialCurrentPoints (Operators like >,<,==,>=,<=,!=) Value]
Example: currentCustomer.initialCurrentPoints > 500 or
Example -> currentCustomer.initialCurrentPoints != currentCustomer.currentPoints
Learn More
initialLifetimePointsData Type: BigDecimal
Meaning: customer's lifetime redeemable points before current event
initialLifetimePoints = customer lifetime earned redeemable points - returned points since start(before evaluating an event)
NANASyntax: [currentCustomer.initialLifetimePoints (Operators like >,<,==,>=,<=,!=) Value]
Example : Suppose you want to issue coupons to those customers whose lifetime purchase is greater than 5000. Then use the following condition: currentCustomer.lifetimePurchase>5000
Learn More
initialSlabNameReturn type: Boolean
data type: string
Customer's tier name before evaluating the event or before current event
NANASyntax: currentCustomer.initialSlabName("SLAB NAME")
Example ->(currentCustomer.initialSlabName=="Normal"||currentCustomer.initialSlabName=="Silver"
||currentCustomer.initialSlabName=="Bronze"||currentCustomer.initialSlabName=="Gold")
Learn More
initialSlabNumberData type: Int
Customer's tier number before evaluating the event
NANASyntax: [currentCustomer.initialSlabNumber(Operators like >,<,==,>=,<=,!=) Value ]
Example :- lets say you want to give reward points only when current slab number is greater than initial slab number and current Slab Number is equals 3 then ==> ((currentCustomer.slabNumber > currentCustomer.initialSlabNumber) && (currentCustomer.slabNumber == 3))
Learn More
joinDateData Type: Date
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
Example :currentTxn.date.dateDiff(currentCustomer.joinDate)<=7&&(currentTxn.value>=250)Learn More
lifetimePointsData Type: BigDecimal
Total points earned by a customer from the date of registration
lifetime points = overall redeemable points earned - overall returned points
NANASyntax: [currentCustomer.lifetimePoints(Operators like >,<,==,>=,<=,!=) Value]
Example :- currentCustomer.initialLifetimePoints<500&&(currentCustomer.lifetimePoints>=500
Example:- currentCustomer.lifetimePoints>30
Learn More
lifetimeNonRedeemablePointsData Type: BigDecimal
customer earned promised points - returned points since start
lifetime non redeemable points = overall non redeemable points earned - overall non redeemable returned points
NANASyntax: [currentCustomer.lifetimeNonRedeemablePoints.(Operators like >,<,==,>=,<=,!=) Value]
Example:- currentCustomer.lifetimeNonRedeemablePoints>30
Learn More
lifetimePurchasesdata type: BigDecimal
customer's purchase since start including current transaction's purchase
lifetime purchase = sum of all purchase - sum of refund amount
NANASyntax: currentCustomer.lifetimePurchase[Operators][value]
Example: currentCustomer.lifetimePurchase<=1000
Learn More
mobileData Type : IntegeMobile number of a customer(Passed in the request Payload)NANALearn More
numberOfTxnsData type: int
Total number of transactions made by a customer from the date of registration
NANALearn More
numberOfTxnsTodayData type : int
Number of transactions made by a customer the current day
NANASyntax: currentCustomer.numberofTxnsToday (Operators like >,<,>=,<=,==) Value
Example: (currentCustomer.numberOfTxnsToday == 1)
Example: currentCustomer.slabNumber==5&&(currentCustomer.numberOfVisits==1)&&(currentCustomer.numberOfTxnsToday==1)
Learn More
numberOfVisitsData type : int
number of unique days when customer made transaction
Total number of times a loyalty customer visited your stores (made transactions in different days lets say customer visited the store 7 times in a week but made a transaction in 5 days so total visits == 5)
NANASyntax: currentCustomer.numberOfVisits (Operators like >,<,>=,<=,==) Value
(Example: currentTxn.basketIncludes("RetekClass","T Shirt")&&(currentTxn.value>3000)&&(currentCustomer.numberOfVisits==1)
Learn More
SlabNameData type: String
Name of the current loyalty tier of a customer
NANASyntax: currentCustomer.SlabName (Operators like ==, matches, contains)"SLAB NAME"
Example : currentTxn.value>100&&(currentCustomer.slabName.matches("SILVER))
currentCustomer.slabName=="Priviledged"
Learn More
SlabNumberData Type: Integer
Serial number of the current tier
NANASyntax: currentCustomer.SlabNumber(Operators =,>,<,>=,<=)Value
Example : currentCustomer.SlabNumber >4
Learn More
isLoyalOutput type: Boolean
Checks if the current customer is registered in the brand's loyalty program
NANAExample: currentCustomer.isLoyal==trueLearn More
hasInstoreProfileOutput type: Boolean
Checks if the current customer has InStore profile
NANAExample: currentCustomer.hasInstoreProfile==trueLearn More
hasWeChatProfileOutput type: Boolean
Checks if the current customer has WeChat profile
NANAExample: currentCustomer.hasWeChatProfile==trueLearn More
doesProfileExistsOutput type: Boolean
Checks if a specific profile
NANAExample: currentCustomer.doesProfileExists==trueLearn More

Expressions on current transaction profile (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. Learn More

📘

  • Value = Gross amount (rate*quantity)
  • Rate = Gross price of a line item
  • Amount = Value-discoun
ATTRIBUTEDESCRIPTION OF ATTRIBUTESUB ATTRIBUTESDESCRIPTION OF SUB-ATTRIBUTESYNTAX AND EXAMPLEDETAILED DOCUMENTATION
numberTransaction number of the current transactionNANALearn More
basketSum()Type: BigDecimal
Meaning: sum of amount of all lineitems which are matching input inventory attribute and their inventory attribute value matches exactly with input attribute value
currentTxn.basketSum("Attribute Name","Inventory Value")Attribute Name : The custom Field Name
Attribute Value: Custom Field Value
Example currentTxn.basketSum("company_code","PETRON"), this will give the sum of amount of all the petron products of company_code inventory.Learn More
basketSumRegex()Data type : BigDecimal
Meaning:- sum of amount of all lineitems which are matching input inventory attribute and their inventory attribute value matches with input regex.
example :- currentTxn.basketSumRegex("company_code","PET.*")
currentTxn.basketSumRegex("Attribute Name","Attribute Regex")1.Attribute Name : The custom Field Name.
2. Sub Attribute Value Regex: Regex to check the match with the Value.
currentTxn.basketSumRegex("company_code","PET.*")Learn More
basketQtyRegex()Type : BigDecimal
Meaning:- sum of quantity of all lineitems which are matching input inventory attribute and their inventory attribute value matches with input regex
Example :- currentTxn.basketQtyRegex(""company_code"",""PET.*"")
currentTxn.basketQtyRegex("Attribute Name","Attribute Field Value Regex")1. Sub Attribute Name : The custom Field Name.
2. Sub Attribute Value Regex: Regex to check the match with the Value.
Syntax: currentTxn.basketQtyRegex("Attribute Name","Attribute Field Value Regex")
Example: currentTxn.basketQtyRegex("company_code","PET.*")
Learn More
basketCount()Type :- int
Meaning :- count of lineitems from request payload which are matching input inventory attribute and their inventory attribute value matches exactly with input attribute value.
Example :- currentTxn.basketCount(""company_code"",""PETRON"")
currentTxn.basketCount("Attribute Name","Attribute Field Value")1. Sub Attribute Name : The custom Field Name
2. Sub Attribute Value: Value of the sub-Attribute.
Example: currentTxn.basketCount("Dvs","DVS_Flag")>1Learn More
basketCountRegex()Type:- int
Meaning:- count of lineitems from request payload which are matching input inventory attribute and their inventory attribute value matches with input regex
currentTxn.basketCountRegex(""company_code"",""PET.*"")
Pass attribute and regex of the attribute that you want to validate
currentTxn.basketCountRegex("Inventory Attribute","Regex")
1. Sub Attribute Name : The Inventory Attribute name.
2. Sub Attribute Value Regex: Regex to check the value match.
Syntax: currentTxn.basketCountRegex("Inventory Attribute","Regex")
Example: currentTxn.basketCountRegex(""company_code"",""PET.*"")
basketIncludes()Type :- Boolean
Meaning: return true if any lineitem matches input inventory attribute and their inventory attribute value matches exactly with input attribute value
Pass attribute and value pair.
currentTxn.basketIncludes("Attribute Name","Attribute Value")
1. Sub Attribute Name : The Inventory Attribute name.
2. Sub Attribute Value: Inventory attribute value
Syntax: currentTxn.basketIncludes("Attribute Name","Attribute Value")
Example : currentTxn.basketIncludes(""company_code"",""PETRON"")
Learn More
basketExcludes()Type :- Boolean
Meaning:- return false if any lineitem matches input inventory attribute and their inventory attribute value matches exactly with input attribute value
Pass attribute and value pair.
currentTxn.basketExcludes("Attribute Name","Attribute Value"
1. Sub Attribute Name : The Inventory Attribute name.
2. Sub Attribute Value: Inventory attribute value
Syntax: currentTxn.basketExcludes("Attribute Name","Attribute Value")
Example: currentTxn.basketExcludes(""company_code"",""PETRON"")
Learn More
basketIncludesRegex()Type:- Boolean
Meaning:- return true if any lineitem matches input inventory attribute and their inventory attribute value matches with input regex.
Pass attribute and value pair.
currentTxn.basketIncludesRegex("Attribute Name","Attribute Regex")
1. Sub Attribute Name : The Inventory Attribute name.
2. Sub Attribute Value Regex: Regex to check the value match.
Syntax: currentTxn.basketIncludesRegex("Attribute Name","Attribute Regex")
Example:- currentTxn.basketIncludesRegex(""company_code"",""PET.*"")
basketExcludesRegex()Type:- BooIean
Meaning:- return false if any lineitem matches input inventory attribute and their inventory attribute value matches with input regex or the bill does not include products whose item attribute does not match the given regular expression it returns False
Pass attribute and value pair.
currentTxn.basketExcludesRegex("Inventory Attribute Name","Inventory Attribute value regex)
1. Sub Attribute Name : The Inventory Attribute name.
2. Sub Attribute Value Regex: Regex to check the value match.
Syntax: currentTxn.basketExcludesRegex("Inventory Attribute Name","Inventory Attribute value regex)
Example: currentTxn.basketExcludes("Jeans","XXX")
basketSumIf"Type : Boolean
Meaning:- Returns the sum of amount of line items (in basket) that satisfies a specific condition. You can define conditions based on the amount, discount, quantity, rate, or value of line items in the basket. For example, sum of line items amount in the basket whose quantity is more than 2.
Example : currentTxn.basketSumIf(""DISCOUNT"",""GREATER_THAN"",""10"")
currentTxn.basketSumIf(""RATE"",""GREATER_THAN_EQUAL_TO"",""60"")"
Supported Sub-Attribute:
AMOUNT, DISCOUNT, QUANTITY, RATE, and VALUE
Supported parameters:
AMOUNT, DISCOUNT, QUANTITY, RATE, and VALUE

Supported Operators:
GREATER_THAN, LESS_THAN, LESS_THAN_EQUALS_TO, GREATER_THAN_EQUALS_TO, EQUALS_TO, NOT_EQUALS_TO
Standard expression:
basketSumIf(“{parameter}”, “{expression}”,"{value}")[operator]{value})

Example: From the basket items, calculate the total amount of line items whose quantity is greater than or equal to 3. If this value is greater than 100, then execute a specific action.
currentTxn.basketSumIf("QUANTITY","GREATER_THAN_EQUAL_TO","3")>100
Learn More
basketCountIftype:- BigDecimal
Meaning :- Returns the count of line items of the basket that satisfies a specific condition. You can define condition based on the amount, discount, quantity, rate, or value of line items in the basket.
Example :- currentTxn.basketCountIf("DISCOUNT","GREATER_THAN","10")
Supported Sub-Attribute:
AMOUNT, DISCOUNT, QUANTITY, RATE, and VALUE
Supported parameters:
AMOUNT, DISCOUNT, QUANTITY, RATE, and VALUE

Supported Operators:
GREATER_THAN, LESS_THAN, LESS_THAN_EQUALS_TO, GREATER_THAN_EQUALS_TO, EQUALS_TO, NOT_EQUALS_TO
expression:
basketCountIf(“{parameter}”, “{expression}”,"{value}")[operator]{value})
Example: Count of line items from the basket whose amount is less than 50. If this count exceeds 3, then execute an action.
currentTxn.basketCountf("AMOUNT","LESS_THAN","50")>3
Learn More
basketQtyIftype:- BigDecimal
Meaning:- Total number of items in the bill - irrespective of quantity of each item or we can say that its a number of lineitems passed in payload
currentTxn.basketQtyIf("DISCOUNT", "LESS_THAN", "10")
Supported Sub-Attribute:
AMOUNT, DISCOUNT, QUANTITY, RATE, and VALUE
Supported parameters:
AMOUNT, DISCOUNT, QUANTITY, RATE, and VALUE

Supported Operators:
GREATER_THAN, LESS_THAN, LESS_THAN_EQUALS_TO, GREATER_THAN_EQUALS_TO, EQUALS_TO, NOT_EQUALS_TO
Standard expression:
basketQtyIf(“{attribute}”, “{expression}”,"{value}")[operator]{value})
Example : Calculate the sum of the quantity of all line items in the basket whose discount value is $10 or above. If the quantity of those line items is more than 20, execute an action.
currentTxn.basketQtyIf("DISCOUNT","LESS_THAN_EQUALS_TO","10")>20
Learn More
basketSizeType: Int
Meaning: number of lineitems passed in payload or Total number of items in the bill - irrespective of quantity of each item
NANAcurrentTxn.basketSize<10Learn More
basketSumGrossType:- BigDecimal
Meaning:- sum of gross amount(value) of all lineitems which are matching input inventory attribute and their inventory attribute value matches exactly with input attribute value Supported attribute names: product name, short description, SKU number, category, and subcategory.
Example :- currentTxn.basketSumGross("company_code","PETRON")
Sub Attributes: Inventory Attribute Name and Inventory Attribute Value.1. Sub Attribute Name : The Inventory Attribute name.
2. Sub Attribute Value: Inventory attribute value
Standard expression:
currentTxn.basketSumGross{("[Attribute Name]","[Inventory Value]")[Operator][Value]}
Sample expression: If the total gross amount of line items in the basket with attribute name value is "demoname", exceeds 2000, then execute a specific action.
currentTxn.basketSumGross("name","demoname")>2000
Learn More
basketSumRegexGrossType:- BigDecimal
Meaning:- sum of gross amount(value) of all lineitems which are matching input inventory attribute and their inventory attribute value matches exactly with input attribute value or Returns the sum of gross amount of each line item in the basket whose product attribute values match the given regular expression.
Example :- currentTxn.basketSumGross("company_code","PETRON")
1. Sub Attribute Name : The Inventory Attribute name.
2. Sub Attribute Value Regex: Regex to check the value match.
Standard expression:
currentTxn.basketSumRegexGross{("[Attribute Name]","[Attribute Regex]")[Operator][Value]}
Sample expression: If the sum of gross amount of line items of the basket, whose attribute name (brand) starts with purple, exceeds 5000 execute a specific action.
currentTxn.basketSumRegexGross("brand","^purple")>5000
Learn More
basketSumRegexBrandGrossReturns the sum of the gross amount of each line item in the basket whose brand name matches with the given the regular expression. Calculates the total gross amount of basket items whose brand name contains xyz.
Example: currentTxn.basketSumGrossRegex("company_code","PET.*")
Only one sub-Attribute i.e the Regex.Regex: Brand name Regex.Standard expression:
currentTxn.basketSumRegexCategoryGross{("[Regex]")[Operator][Value]}
Sample expression: If the sum of gross amount of line items of the basket with brand names containing 'demo', exceeds 1000 execute a specific action.
currentTxn.basketSumRegexCategoryGross("demo*")>1000
Learn More
basketSumRegexCategoryGrossReturns the total gross amount of line items in the basket whose category names matches with the given regular expression.
currentTxn.basketSumRegexCategoryGross{("[Regex]")[Operator][Value]}
Example expression: currentTxn.basketSumRegexCategoryGross("^shirt")>1000 If the sum of gross amount of line items of the basket whose category names that start with shirt, exceeds 1000 execute a specific actio
Only one sub-Attribute i.e the Regex.Regex: Product Category RegexStandard expression:
currentTxn.basketSumRegexCategoryGross{("[Regex]")[Operator][Value]}
Sample expression: If the sum of gross amount of line items of the basket whose category names that start with shirt, exceeds 1000 execute a specific action.
currentTxn.basketSumRegexCategoryGross("^shirt")>1000
customFieldValueExcludesType: Boolean
Meaning: returns False if input custom field value matches with bill's custom fields
Example Expression : currentTxn.customFieldValueExcludes("bank","SBI")
customFieldValueExcludes("Field","Value")
Sub-Attribute: Custom-Field Name and Custom Field Value
Sub-Attribute: Custom-Field NAME and Custom Field ValueExpression: currentTxn.customFieldValueExcludes(“Brand”,”Puma”)Learn More
customFieldValueIncludes()Type: Boolean
Meaning: returns true if input custom field value matches with bill's custom fields or Check if customer's transaction level custom field value includes the given value
Example Expression : currentTxn.customFieldValueIncludes("bank","SBI")
customFieldValueIncludes("Field","Value")
Sub-Attribute: Custom-Field NAME and Custom Field Value
Sub-Attribute: Custom-Field NAME and Custom Field ValueExpression: currentTxn.customFieldValueIncludes(“Brand”,”Puma”)Learn More
discountType: BigDecimal
Discount availed for a transaction
NANAcurrentTxn.discount>200Learn More
dateData Type : DateMeaning: Date of current transaction under evaluation dateDiff, day, dayOfMonth, daysDiff, daysDiffFromString, isAfter, isHourBetween, isTimeBetween, isValid, isWeekday, isWeekend, month, and yearLinkExample of year Attribute :returns the year from the date e.g. currentTxn.date.year( )>=1981Learn More
pointsType: BigDecimal
Meaning :Total points issued for a transaction; (Points = Promoised points + redeemable points)
NANA
totalQtyType: IntegerTotal 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.NANASyntax: currentTxn.totalQty[Operator][Value]
CcurrentTxn.totalQty>4
valueTotal value of the transactionintervalNASyntax: currentTxn[Operator][value]
currentTxn.value>8000
[Learn More](https://docs.capillarytech.com/docs/attribute-transaction-valu
notesTransaction level notes specified by the cashier during transactioncontains, exists, isEmpty, isNotNull, isNull, isValidDate, matches, and notExistsNAcurrentTxn.notes.exists("Special discount")Learn More

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. Learn More

ATTRIBUTEDESCRIPTION OF ATTRIBUTESUB ATTRIBUTEDESCRIPTION OF SUB-ATTRIBUTESYNTAX AND EXAMPLEDETAILED DOCUMENTATION
codeItem code of the line-item as assigned in the inventoryNANASyntax: currentLineItem.code[Operator][Value]
currentLineItem.code!="2"
currentLineItem.code.contains("8907411447726")
Learn More
descriptionThe description specified for the of the line-item in the inventoryNANASyntax: currentLineItem.description[Operator][Value]
Rule: currentLineItem.description.isNotNull()
Learn More
discountPercentage lineitem discount % = (discount/amount * 100)

Meaning: Discount value needs to be passed in api request payloadThe description specified for the line-item in the inventory, passed in the payloads.
NANASyntax: Syntax: currentLineItem.discountPercentage[OPERATORS][VALUE]
Example : currentLineitem.discPercentage>15
Learn More
doesItemMatch()Check if an item code matches with the given codedoesItemMatch("","")1. Attribute Name
2. Attribute Value
Syntax: currentLineItem.doesItemMatch(“custom field Name”,”custom field Value”)(currentLineItem.doesItemMatch("BarcodeExclusionNew2020","No")(currentLineItem.doesItemMatch("H2_new","DIS-DISCONTINUE")Learn More
qtyQuantity of a line-item purchasedNANASyntax: currentLineItem.qty [Operators][VALUE]
currentLineItem.qty<6
Learn More
rateActual price of a line-itemNANASyntax: currentLineItem.rate >1000
currentLineItem.rate<100000&&(currentLineItem.discount==0)
valueSelling price of a line-itemNANASyntax: currentLineItem.value[operator][Value]
currentLineItem.value<100000&&(currentLineItem.discount==0)
Learn More

Current Tracker Condition (currentTrackerCondition)

This currentTrackerCondition is used to write rules based on the recent tracker condition. Learn More

ATTRIBUTEDESCRIPTIONSUB ATTRIBUTESEXAMPLEDetailed Documentation
numberOfVisitsreturns number of visits tracked by current tracker. works only for customer visit tracker.NAcurrentTrackerCondition.numberOfVisits>5[Learn More](https://docs.capillarytech.com/docs/profile-currenttracker#attribute-numberofvisits
trackedValuereturns tracked value in the tracker for current event.NAcurrentTrackerCondition.trackedValue>5000Learn More
trackerConditionNamereturns current tracker condition nameNAcurrentTrackerCondition.trackerConditionName=="Cond1"Learn More
trackerConditionPeriodreturns tracking period valueNAcurrentTrackerCondition.trackerConditionPeriod>15Learn More
trackerCurrAggrreturns aggregate tracked value in current tracking period for all events including current eventNAcurrentTrackerCondition.trackerCurrAggr>5000Learn More
trackerInitialPrevAggrreturns aggregate tracked value in current tracking period for all events excluding current eventNAcurrentTrackerCondition.trackerInitialPrevAggr>4000Learn More
trackerNamereturns tracker nameNAcurrentTrackerCondition.trackerName=="Tracker1"Learn More
trackerPrevAggrreturns aggregate tracked value in current tracking period for all events excluding current eventNAcurrentTrackerCondition.trackerPrevAggr>4000

Current Event (currentEvent)

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

ATTRIBUTEDESCRIPTION OF ATTRIBUTESUB ATTRIBUTESDetailed Documentation
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")
Learn More
currentCustomFieldValue()Value of custom field after updatingcurrentEvent.currentCustomFieldValue("Custom Field Name","Field Value")

Example:
currentEvent.currentCustomFieldValue("age_group","value")
Learn More
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 first name after updatingNA
currentFirstNameCustomer's first name after updatingNA
currentLastNameCustomer's last name after updatingNA
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"
Learn More
currentLoyaltyTypeChecks the current loyalty status of the customer. Supported only for CustomerUpdate eventValues: LOYALTY/NON_LOYALTYLearn More
targetAchievedProvides the numeric value of the actual achievement of the customer for the given target.currentEvent.targetAchieved("Target Name")Learn More
targetDefinedProvides the numeric value of the target set by the marketing/org user for that customer.currentEvent.targetDefined("Target Name")
targetExistsChecks if a target value exists or set by the marketing user for that customer.currentEvent.targetExists("Target Name")
targetGroupReturns the name of the target group for which the current event is being executed. This is used to target customers in different groups.currentEvent.targetGroup
targetPeriodReturns the name of the target period for which the current event is being executed. This is used to target customers across different groups.currentEvent.targetPeriod
isTargetAchievedEventVerifies whether a customer has completed the allotted target before the target period ends.

Applicable only to Target period elapses event.
currentEvent.isTargetAchievedEvent
isUnifiedTargetAchievedEventVerifies whether the event that arrived to loyalty promotions is a unified target achieved event.

Applicable only for target-period elapsed event
currentEvent.isUnifiedTargetAchievedEvent
isStreakAchievedEventVerifies whether the event that arrived at loyalty promotions is a streak-level achieved event.

Applicable only for target-period elapsed event
currentEvent.isStreakAchievedEvent
isSubTargetAchievedEventVerifies whether the event that arrived at loyalty promotions is a sub-target achievement by a user.

Applicable only for target-periods elapsed event
currentEvent.isSubTargetAchievedEvent

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.

ATTRIBUTEDESCRIPTIONSUB ATTRIBUTESDetailed Document
codeUnique code of the storeNALearn More
nameName of the storeNA

Tender Profile (tenderProfile)

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

ATTRIBUTEDESCRIPTIONSUB ATTRIBUTESDESCRIPTION OF SUB-ATTRIBUTEOPERATORSSYNTAX AND EXAMPLE
amountData Type: BigDecimal
The amount paid for a transaction using the payment mode
NANA> ,<,>=,<=,==Syntax: tenderProfile.amount[Operator][Value]
codeData Type: String
Returns code or name of the combination created in loyalty for the payment mode
NANAcontains, exists, isEmpty, isNotNull, isNull, isValidDate, matches and notExiststenderProfile.code[Operator][Value]
notesData Type: String
Returns notes described for the tender
NANAcontains, exists, isEmpty, isNotNull, isNull, isValidDate, matches and notExiststenderProfile.notes[Operator][Value]

Return Bill (returnBill)

The returnBill profile is used to return the bill amount 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.

ATTRIBUTEDESCRIPTIONSUB ATTRIBUTES
basketCountNumber of products in the transaction of the given inventory type - irrespective of quantityNA
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 expressionreturnBill.basketCountRegexBrand("Brand Name","Regex")
basketCountRegexCategoryNumber of products whose category name matches the given regular expressionreturnBill.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 expressionExample:
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 brandreturnBill.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 transactionreturnBill.basketQty("Attribute Name","Attribute Value")
basketQtyRegex()Quantity of items in the bill matching the regular expressionreturnBill.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 expressionreturnBill.basketQtyRegexCategory("Category Name","Regex")
basketSizeTotal number of items in the bill - irrespective of quantity of each itemNA
basketSum()Sum of value of the items matching the inventory attributeExample:
returnBill.basketSum("Product","Shirt")
basketSumRegex()Sum of value of the items matching the inventory attribute - regular expressionExample:
returnBill.basketSum("Product","Regex")
customFieldValueExcludes()Transaction custom field excludes the given valuePass 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 valuePass the custom field value that you want to validate as shown below
customFieldValueIncludes("Field","Value")

Example:
returnBill.customFieldValueIncludes("a_customertype","Loyalty")
dateDate of transactiondateDiff, 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
discountDiscount availed for a transactionNA
notesTransaction level notes specified by the cashier during transactioncontains, exists, isEmpty, isNotNull , isNull , isValidDate, matches, and notExists
numberTransaction number of the current transactioncontains, exists, isEmpty, isNotNull, isNull, isValidDate, matches, and notExists
pointsTotal points issued for a transactionNA
totalQtyDate of transactionNA

Current Customer Partner (currentCustomerPartner)

This currentCustomerPartner consists of attributes related to fetching customer partner's profile information and loyalty details as listed in the table below.

ATTRIBUTEDESCRIPTIONSUB ATTRIBUTES
additionalBenefitsInMembershipCycleAdditional benefits available during the membership life cycleNA
benefitsAvailedInActiveMembershipBenefits that are available with the active membershipNA
benefitsAvailedInEventCycleBenefits available during the event cycleNA
benefitsLimitThe maximum or minimum limit of benefit that can be availedNA
countBillsCurrentCycleCalculate the number of bills generated during the current cycleNA
countPromotionPointsIssuedCurrentCycleCalculate the number of points issued during the current cycleNA
daysElapsedInCurrentCycleNumber of days elasped in current cycle for customer partnerNA
isLinkedOnSpecificDateChecks if the current cutomer partner is linked on a specific date or not.NA
isLinkedToChecks if the current cutomer partner is linked to a loyalty program or notNA
sumPurchaseValueCurrentCycleSum of all purchase value during current cycleNA

Group Primary Customer (groupPrimaryCustomer)

This groupPrimaryCustomer is used to write rules for the primary customer.

ATTRIBUTEDESCRIPTIONSUB ATTRIBUTES
avgBasketSizeLets you evaluate conditions on the average basket size of the primary customer.

(The ratio of the total quantities of line items purchased to the total number of transactions made).
isNotNull and isNull
avgSpendPerVisitLets you evaluate conditions on the average spend per visit by the primary customer.

(Total purchases amount)/ (Total number of transactions made).
interval, isNotNull and isNull
clusterValueExcludesNA
clusterValueIncludesNA
countActiveCouponsInCouponSeriesLets you evaluate conditions on the count of active coupons of the primary customer.NA
currentAllPointsinterval, isNotNull and isNull
currentNonRedeemablePointsLets you evaluate conditions on the current points that are not redeemable by the primary customer.interval, isNotNull and isNull
currentPointsLets you evaluate conditions on the active points of the primary customer.interval, isNotNull and isNull
customFieldValueExcludesLets you evaluate conditions on a custom field value of the customer. (Any value other than the value you mention here).NA
customFieldValueExistsLets you evaluate conditions on a custom field value of the primary member ( if a specific custom field value exists for the member).NA
customFieldValueIncludesLets you evaluate conditions on a custom field value of the primary member (if a specific custom field value exists for the member).NA
doesProfileExistsLets you evaluate conditions on the availability of the primary member's profile/account.NA
emailLets you evaluate conditions on email of the primary customer.contains, exists, isEmpty, isNotNull, isNull, isValidDate, matches and notExists
extFieldNA
externalIdLets you evaluate conditions on the external ID values of the primary member.contains, exists, isEmpty, isNotNull, isNull, isValidDate, matches and notExists
firstnameLets you evaluate conditions on the first name of the primary customer.contains, exists, isEmpty, isNotNull, isNull, isValidDate, matches and notExists
hasInstoreProfileLets you evaluate conditions based on the primary customer's Instore profile.isNotNull and isNull
hasWeChatProfileLets you evaluate conditions based on the primary customer's WeChat profile.isNotNull and isNull
includesLabelRegexNA
initialCurrentAllPointsinterval, isNotNull and isNull
initialCurrentPointsinterval, isNotNull and isNull
initialLifetimePointsinterval, isNotNull and isNull
initialLifetimePurchaseinterval, isNotNull and isNull
initialSlabNamecontains, exists, isEmpty, isNotNull, isNull, isValidDate, matches and notExists
initialSlabNumberisNotNull and isNull
isControlisNotNull and isNull
isGroupMemberisNotNull and isNull
isLoyalisNotNull and isNull
isPrimaryisNotNull and isNull
isRegisteredOnNA
isSecondaryisNotNull and isNull
isTestisNotNull and isNull
joinDateLets you evaluate conditions based on the registration date of the primary customer.dateDiff, day dayOfMonth, daysDiff, daysDiffFromString, isAfter, isHourBetween, isNotNull, isNull, isTimeBetween, isValid, isWeekday, isWeekend, minutesDiff, month, year
lastnameLets you evaluate conditions based on the last name of the primary customer.contains, exists, isEmpty, isNotNull, isNull, isValidDate, matches and notExists
lifetimeAllPointsinterval, isNotNull and isNull
lifetimeNonRedeemablePointsinterval, isNotNull and isNull
lifetimePointsLets you evaluate conditions on lifetime points of the primary customer.interval, isNotNull and isNull
lifetimePurchaseLets you evaluate conditions on lifetime purchases of the primary customer.interval, isNotNull and isNull
mobileLets you evaluate conditions on the mobile number of the primary customer.contains, exists, isEmpty, isNotNull, isNull, isValidDate, matches and notExists
nameLets you evaluate conditions based on the name of the primary customer.contains, exists, isEmpty, isNotNull, isNull, isValidDate, matches and notExists
numberOfRedemptionsInCalendarMonthLets you evaluate conditions based on the number of times points are redeemed in the current calendar month.isNotNull and isNull
numberOfRedemptionsInCalendarWeekLets you evaluate conditions based on the number of times points are redeemed in the current calendar week. (Monday to Sunday)isNotNull and isNull
numberOfRedemptionsInPastDaysLets you evaluate conditions based on the number of times points are redeemed in the last x days.NA
numberOfRedemptionsTodayLets you evaluate conditions based on the number of times points are redeemed on the present day.isNotNull and isNull
numberOfTxnsLets you evaluate conditions on the total number of transactions by a primary customer.isNotNull and isNull
numberOfTxnsTodayLets you evaluate conditions on the number of transactions made by the primary customer on the current day.isNotNull and isNull
numberOfVisitsLets you evaluate conditions on the number of visit primary customer.isNotNull and isNull
pointsRedeemedInCalendarMonthLets you evaluate conditions on points redeemable by a primary customer in the calendar month.interval, isNotNull and isNull
pointsRedeemedInCalendarWeekLets you evaluate conditions on points redeemable by a primary customer in the current calendar week.interval, isNotNull and isNull
pointsRedeemedInPastDaysLets you evaluate conditions on points redeemable by a primary customer in the last x days.NA
pointsRedeemedTodayLets you evaluate conditions on points redeemable by a primary customer on the present day.interval, isNotNull and isNull
slabChangeDateLets you evaluate conditions based on the tier change date by the primary customer.dateDiff, day dayOfMonth, daysDiff, daysDiffFromString, isAfter, isHourBetween, isNotNull, isNull, isTimeBetween, isValid, isWeekday, isWeekend, minutesDiff, month, year
slabExpiryDateLets you evaluate conditions based on the tier expiry date of the primary customer.dateDiff, day dayOfMonth, daysDiff, daysDiffFromString, isAfter, isHourBetween, isNotNull, isNull, isTimeBetween, isValid, isWeekday, isWeekend, minutesDiff, month, year
slabNameLets you evaluate conditions on the tier name of a primary customer.contains, exists, isEmpty, isNotNull, isNull, isValidDate, matches and notExists
slabNumberLets you evaluate conditions on the tier number of the primary customer.isNotNull and isNull

Referrer Code (referrerCode)

This referrerCode is used to write rules based on the referrer code details.

ATTRIBUTEDESCRIPTIONSUB ATTRIBUTES
refereeRegCountTotal number of registered refereeisNotNull and isNull
refereeTxnCountNumber of transactions done by the refereeisNotNull and isNull