Scenario to show Promotion only for New customers

Scenario : Imagine you have a captivating promotion that you want to exclusively offer to new customers, creating a buzz and attracting fresh faces to your products. The challenge is to restrict this promotion in a way that it is accessible only to those customers who are venturing into your brand for the first time.

When we finish this blog post, we will have accomplished the following.


Let us begin and work our way through this step by step. We will achieve this with the help of VLOCITY PICKLIST, CONTEXT SCOPES, CONTEXT DIMENSION, CONTEXT MAPPING, CONTEXT RULE, RULE CONDITIONS, RULE SET

VLOCITY PICKLIST : These are intended to be globally reusable across EPC, including within context dimensions. This picklist will be used to populate the context dimension, which we will create later.
Step 1 : Create a Picklist and then a Picklist Item under that Picklist. These picklist items will appear in the context dimension, which the context rules service engine will use to match against specified sObject fields.


Context Scopes : The relational path from a root sObject, like an Order, to related sObjects is described by context scopes. Context mappings use them to identify the fields on the sObjects that the context rule service engine will compare against context dimension variables stored in the org cache.
Step 2 : As shown in the image below, create a context scope and enter value in the required fields.


Context Dimension : A variable that holds potential values to be used in a context rule condition is called a context dimension. Context dimensions are reusable between rule conditions. The rules engine compares context dimensions with information derived from a function, a sObject, or a static value specified in the context mapping.
Step 3 : Enter the required field value in the New Context Dimension dialogue box in accordance with the image below. Context dimension names cannot contain any spaces due to requirements from the rule engine.


Context Mapping : A context mapping is the magic link that allows the rules engine to compare context dimensions to data stored in sObjects, calculated using a function, or typed in during design time within a given context scope. Before configuring context mapping, context scopes and context dimensions must be defined. To improve performance, context mappings are cached in the org cache.
Step 4 : In the context dimension window, Click the Context Mappings facet in the left sidebar. Click New Context Mapping and update the information as shown below.


Context Rule : The context rule includes header information as well as one or more conditions. In the case of a qualification rule, comparing the value to the rule condition determines whether the rule passes or fails.
Step 5 : Enter the following information in the New Rule dialogue, as shown in the image, and then click OK. Click the Rule Conditions facet in the left sidebar, and then change the value in the Value field to New. These values are derived from the AccountStatus Vlocity picklist items that we previously created.


Rule Set : Enter the following information in the New Rule Set dialogue, as shown in the image, and then click Save. Click the Children Rules facet in the left sidebar. In the General Properties dialogue on the right, enter the following information. You can add one or more rules as child rules to a rule set. When you select multiple child rules, the rule set’s expression mode and other factors determine how those rules are applied.
Step 6 :


We are now finished with the rule set. Let’s use this with the promotion we made earlier. If you missed it, please read the previous post.
Step 7 : Click the edit icon next to the iPhone X Intro Promo in the Search Promotion dialogue, and then Click the Context Rules facet in the left sidebar, then click Add Rule Set.Search for and select New Accounts Rule Set in the Add Rule Set dialogue box.The rule set will appear in the Context Rules QUALIFICATION list for the promotion.

To test this, open any order that is associated with an account that is not new, and you will see that the promotion is not available, whereas if you configure an order that is associated with an account that is new, you will see that the promotion is available.

Hope this information helps you guys.

Stay tuned for the next post, in which we’ll go into more detail about pricing scenarios in bundled products.

Cheers!!!

Mukul Sharma