Skip to main content
Dreamforce is streaming for free on Salesforce+. Watch now.

Create a Rule and Activate the Process

Create a Rule

Mary creates a rule that gets the number of points to be debited, checks if a member has sufficient balance, and debits the balance. Additionally, since some rewards have associated vouchers, she creates a condition group and defines a set of conditions to determine whether the transaction journal is eligible for a voucher.

Let’s start with creating the rule.  

  1. In the Cloud Kicks Inner Circle program record, click the Processes tab.
  2. Click the Debit Points for Redemptions program process.
  3. On the Loyalty Process Rules related list, click New.
  4. Specify the following details.
    • Name: Rule to Debit Points
    • Date: Current date
  5. Click Save.

The New Loyalty Program Process Rule window where you provide the name for the rule and associate it with a promotion, if required.

Note

If required, you can also associate the rule with a promotion to ensure that transaction journals are only processed by the rule during the promotion period.

After creating the rule, Mary adds conditions and actions that will help her execute the redemption process.

Add an Action to Run the Decision Table

  1. In the Rule to Debit Points rule, click Add Step.
  2. Hover over Add Action and select Get Outputs from a Decision Table.
  3. Add the following details.
    • Action Name: Run the Decision Table
    • Decision Table: Rewards_Catalog
    • Product: TransactionJournal.Product.Id
    • Partner: TransactionJournal.Partner.Id
    • For Outcome Type, click New Parameter and add the following details.
      • Name: DecisionTableOutcomeType
      • Type: Variable
      • Data Type: Text
      • Click Save.
    • For Single Outcome, click New Parameter and add the following details.
      • Name: PointsFromCatalog
      • Type: Variable
      • Data Type: sObject
      • Object: Rewards Catalog
      • Click Save.
  4. Click Done.
  5. Click Save.

The New Action window where you provide the input and output parameters to run the decision table.

Add an Action to Get Members’ Point Balance

  1. Click Add Step.
  2. Hover over Add Action and select Get Member’s Points Balance.
  3. Add the following details.
    • Action Name: Get Member Point Balance
    • Currency Name: Fixed Value; Regular Points
    • For Points Balance, click New Parameter and add the following details. 
      • Name: MemberPointBalance
      • Type: Variable
      • Data Type: Number
      • Decimal Places: 2
      • Click Save.
  4. Click Done.
  5. Click Save.

The New Action window where you provide the inputs to get a member’s points balance.

Add a Condition to Check If the Member Has Sufficient Points Balance

Note
If you encounter an error after entering the value {!PointsFromCatalog.Points__c} in the Resources field, click inside the field and select the related object from the menu: select PointsFromCatalog > Points__c.
  1. Click Add Step, and select Add Condition.
  2. Add the following details.
    • Condition Name: Does Member Have Sufficient Points Balance?
    • Resources: PointsFromCatalog.Points__c
    • Operator: Less than or equal to
    • Type: Resource
    • Value: MemberPointBalance
  3. Click Done.
  4. Click Save.

The New Condition window where you define the filter criteria to check if a member has sufficient points for redemption.

Add an Action to the Above Condition to Debit Points

  1. Click Add Step to the right (and not the left) of the condition: Does Member Have Sufficient Points Balance?
  2. Hover over Add Action and select Debit Points.
  3. Add the following values.
    • Action Name: Debit Points from Member
    • Currency Name: Fixed Value; Regular Points
    • Points to Debit: PointsFromCatalog.Points__c
  4. Click Done.
  5. Click Save.

The New Action window where you provide the inputs to debit a member’s points balance.

Add a Condition Group to Check for a Voucher

A condition group contains a set of conditions and a default path that can only contain a child action. When the condition group processes the transaction journal, it is evaluated by each condition sequentially. If the transaction journal satisfies a condition, it is no longer evaluated by the subsequent conditions. The child action triggers the selected action, which in this case is to issue the voucher.

  1. Click Add Step right below the Debit Points from Member action, and select Add Condition Group.
  2. Enter Condition Group Name: Check for Voucher
  3. Click Add Condition and add the following details.
    • Condition Name: Condition 1
    • Filter Criteria: All conditions are met (AND)
    • Resource: TransactionJournal.Product.Name
    • Operator: Equals
    • Type: Fixed Value
    • Value: $20 voucher applicable on all footwear
  4. Click Done.
  5. Click Save.

The Condition Group window where you create a condition group to check if a voucher is applicable.

To Condition 1, Mary adds the Issue Voucher action. Anytime a voucher is issued, a code is generated that members use for redemption. Loyalty Management lets you generate codes automatically by enabling the Generate Codes for Vouchers setting in Setup. To learn more about this setting, refer to the Enable Automatic Generation of Voucher Codes help documentation.

  1. Click Add Step to the right of Condition 1.
  2. From the Add Action list, select Issue Voucher and add the following details.
    • Action Name: Issue Voucher 1
    • Voucher Definition Name: Fixed Value, $20 voucher applicable on all footwear
      The remaining voucher details are auto-populated based on the voucher definition.
  3. Click Done.
  4. Click Save.

The Condition Group window where you create an action to issue a voucher if a condition is met.

Note

This project demonstrates the process for only one condition and action. If you want to practice, you can create the remaining conditions and actions based on the rewards catalog. We won’t check for the remaining conditions and child actions added to the Check for Voucher condition group.

Mary clicks Activate to activate the Rule to Debit Points rule. 

The Rule to Debit Points record page with all the conditions and actions required to process redemption-type transactions.

With the rule in place, Mary proceeds to activate the process. 

Activate the Process and Flow

Mary must activate the Debit Points for Redemptions loyalty program process and the Run Loyalty Program Process flow. Here’s how she activates the process.

  1. In the Cloud Kicks Inner Circle program record, click the Processes tab.
  2. Select Debit Points for Redemptions.
  3. Click Activate. In case you don’t see the Activate button, refresh the page.

The Debit Points for Redemptions record page with a view of the rules and parameters

Activate the Flow

In a real-world scenario, the Loyalty Program Process Connect API processes transactions in real time as soon as a member makes a transaction. The Connect API can be integrated with apps that generate transactions for a sale or service, for example, the Point of Sale (POS).

In this project, Mary processes the transactions using the Run Loyalty Program Process flow. Note that this flow has already been created. Mary navigates to the flow to activate it. Here’s what she does.

  1. Click Setup, and select Setup.
  2. Enter Flows in the Quick Find box, and select Flows.
  3. Find and select the Run Loyalty Program Process flow.
  4. Click Activate.

The Flow Builder page where you activate the flow.

Note
If the flow isn’t active, the redemption process won’t run. So it’s important that you activate the flow.

You’ve seen how to set up a loyalty program process from scratch. You can also create and customize a loyalty process using templates. Check out this helpful video that explains how to customize a debit points process using a loyalty program process template.  

Next, you create a transaction journal to see the redemption process in action.

Create a Transaction Journal

Let’s look at how points are debited and updated when a transaction is processed. Adria Darby, an Inner Circle loyalty member, wants to redeem a $20 Cloud Kicks voucher. As soon as the transaction journal is created, Adria is debited with 1000 non-qualifying points. Mary creates a transaction journal to see this in action. 

  1. In the Loyalty Programs tab, select the Cloud Kicks Inner Circle loyalty program.
  2. In the Cloud Kicks Inner Circle program record, click the Members And Partners tab.
  3. Under Loyalty Program Members, select CL001. This record is associated with Adria Darby.
  4. On the Transaction Journals card, click New.
  5. Provide the following details.
    • Journal Type: Redemption
    • Partner: Cloud Kicks
    • Activity Date: Current Date
    • Journal Date: Current Date
    • Status: Pending
    • Loyalty Program: Cloud Kicks Inner Circle
    • Product: $20 voucher applicable on all footwear
  6. Click Save.

The New Transaction Journal window where you manually create a transaction journal.

As soon as the transaction is created, the transaction journal status changes to Processed. Mary sees that the Loyalty Ledgers card is updated with the points, and on the Vouchers card, she finds that the voucher has been issued. 

The transaction journal record after it’s processed.

Mary navigates to the Loyalty Member Currency card on the program member’s record page and sees that the non-qualifying points balance has been debited with 1,000 points.

In Conclusion

Mary is excited at the ease with which she could set up the redemption process. Now customers can seamlessly redeem products and vouchers. With Promotion Setup, you can easily create a redemption process as per your business requirements.

Resources

Compartilhe seu feedback do Trailhead usando a Ajuda do Salesforce.

Queremos saber sobre sua experiência com o Trailhead. Agora você pode acessar o novo formulário de feedback, a qualquer momento, no site Ajuda do Salesforce.

Saiba mais Continue compartilhando feedback