Skip to main content

Add Conditions and Actions to a Rule

Learning Objectives

After completing this unit, you’ll be able to:

  • Explain the use of conditions in a rule.
  • Describe how actions are created for eligible transactions.

Filter Transactions Using Conditions

Conditions help decide whether a transaction is eligible for an action. You can create a condition or a condition group. A condition group is a set of conditions defined together with a default path. A condition can have a child action or a child condition. Define filter criteria for each condition to evaluate the eligibility of transaction journals. When a transaction journal meets the filter criteria, either the child condition further evaluates the transaction journal or the child action is triggered.

Create conditions for transaction journals, members, or related information such as the product associated with the transaction journal, or contact associated with the member. Conditions can also look up an object from the related items of another object. Here’s an example. Cloud Kicks collaborates with cross-industry brands, or partners, to provide members with a wider range of products and services. These partnerships help bring in new business and boost member engagement. Mary filters transactions related to a specific partner. In the condition she uses a resource that filters transactions related to the partner. The resource then looks up the partner name from the transaction journal record. 

Let’s check back in with Mary to understand the conditions for the two rules added to Accrual Process.

Conditions for the Credit Base Points Rule

The first rule has two conditions related to the member tier. 

  • Credit double points to Platinum tier members
  • Credit points equal to the transaction amount to Gold and Silver members.

Mary has created a condition group with two conditions. The first condition filters Gold and Silver tier members and the second condition filters Platinum tier members. She uses a member parameter in the condition to pull up information about the member tier from the member object.

Conditions for the Issue Voucher for Promotion Rule 

For the second rule, Mary would have to add a condition to check if the purchase is part of the promotion. However, this isn’t required because an in-built logic filters transactions for rules associated with promotions and only processes transactions that match the promotion's eligibility criteria.

Here’s a quick summary of the conditions. 

Rule Condition Group

Credit Base Points

Check for Gold and Silver tier

Check for Platinum tier

Issue Voucher for Promotion

None 

Next up, actions that are triggered for applicable transactions.

Take Actions for Eligible Transactions

You can use actions to get information about members, update member records, run flows and decision tables that are created by admins, and so much more. You can either add actions as child steps of conditions or have them be independent of any conditions. Here’s a look at some of these actions available in Loyalty Management. 

Action Description

Assign Parameter Values

Assigns values to one or more parameters. It can be used multiple times in a rule and assigns different values to a parameter.

Credit and Debit Points

Credits or debits points of a member who’s associated with the transaction journal that's processed.

Get Member’s Tier

Retrieves the name of the current tier of the member who’s associated with the transaction journal being processed.

Issue Voucher

Issues a predefined voucher to the member who’s associated with the transaction journal.

Get Member's Points Balance

Retrieves the latest points balance and escrow points balance of the member who’s associated with the transaction journal that’s processed.

Get Outputs from a Decision Table

Runs a decision table for a loyalty process.

Run a Flow

Runs a Loyalty Management Flow type flow.

Update Current Value for the Member Attribute

Updates a member's progress for an engagement attribute.

Get Member's Attribute Values

Fetches details of the Loyalty Program Member Attribute Value record, which represents the current period of the engagement attribute.

Assign Badge to Member 

Assigns the badge to a member for whom the related loyalty program process rule is run.

Check Member Badge Assignment

Checks whether a badge is assigned to a member for whom the rule’s related loyalty program process is run. It verifies whether the member is assigned a badge already to ensure that the badge isn’t assigned multiple times.

Create or Update Records

Creates or updates a record automatically in the Loyalty Management app.

Get Member Promotions

Gets a list of promotions for the member.

Run Program Process

Runs a sub-process within the primary process.

Promotion Setup makes Mary’s job easy because the actions she needs are available out of the box. For the first rule, she uses the Credit Points action and for the second rule, she uses the Issue Voucher action. 

The parameters, conditions, actions, and rules that make up an accrual process.

One of the reasons why Promotion Setup is popular among Loyalty Management users is because of its zero-code or low-code integration. Even if you’re a novice user, you can easily create loyalty processes, without any code and within the Loyalty Management UI.

Check out this helpful video that summarizes the capabilities of Promotion Setup in Loyalty Management.

In the next unit, you’ll look at the different modes used to process incoming transaction journals and test how the process works.

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback