Process Transaction Journals
Activate the Flow
In a real-world scenario, the Loyalty Program Process Connect API processes transactions as soon as members make a transaction. The Connect API can be integrated with apps that generate transactions for a sale or service, for example, Point of Sale (POS) systems.
In this project, Mary processes the transactions using a loyalty flow action called Run Program Process for Transaction Journal. This flow action is used in the Run Loyalty Program Process flow, which is already created for you. Mary navigates to the flow to activate it.
- Click
, and select Setup.
- Enter
Flows
in the Quick Find box, and select Flows.
- Find and select the Run Loyalty Program Process flow.
- Click Activate.
Simulate a Transaction Journal
Mary decides to use simulation to check how the loyalty program process executes pending or processed transaction journals. The loyalty program process runs the journal whose type and subtype match that of the process.
- Click
, and select Loyalty Management.
- In the Program Name column, click Cloud Kicks Inner Circle.
- In the Cloud Kicks Inner Circle program record, click the Members And Partners tab.
- In the Loyalty Program Members related list, select CL001.
- On the Transaction Journals related list, click 00000001.
- In the Loyalty Program Process component, click Simulate.
After the simulation completes, Mary clicks each rule to view how it processed the transaction journal.
The transaction she selected met the first two rules of the accrual process, but not the third rule. So Mary creates a transaction to see how the points are credited and updated when it’s associated with a promotion and meets the attribute target.
Create a Transaction Journal
Adria Darby, a Cloud Kicks Inner Circle member, purchases a pair of Cloud Kicks shoes for $600. When the transaction journal processes, she’s credited with 600 Tier Points and Regular Points each. As Adria qualifies for the promotion, she also gets Regular Points twice that of the transaction amount, which amounts to 1200 Regular Points. Lastly, because she’s met the target of $500, she receives a $10 voucher.
Mary creates a transaction journal to record Adria’s purchase.
- Click
, and select Loyalty Management.
- In the Program Name column, click Cloud Kicks Inner Circle.
- In the Cloud Kicks Inner Circle program record, click the Members And Partners tab.
- In the Loyalty Program Members related list, select CL001.
- On the Transaction Journals related list, click New.
- Add the following details.
- Journal Type: Accrual
- Journal Subtype: Purchase
- Partner: Cloud Kicks
- Activity Date: Current date
- Journal Date: Current date
- Status: Pending
- Loyalty Program: Cloud Kicks Inner Circle
- Product: Super Kicks
- Transaction Amount:
600
- Click Save.
As soon as the transaction journal is created, its status changes to ‘Processed’, and the Loyalty Ledgers card is updated with the points. On the Vouchers card, Mary finds that the voucher is issued. The balances for Regular Points and Tier Points are also updated.
Each time the process runs, it updates Adria’s progress for an engagement attribute. Next, Mary tracks her progress during the lifespan of an engagement attribute.
Track Members’ Progress for Engagement Attributes
A Loyalty Program Member Attribute Value record is created when a member’s progress in achieving the engagement attribute target is updated for the first time during a period. If a member’s progress is tracked across periods, then one Loyalty Program Member Attribute Value record tracks the member's progress across the lifecycle of the attribute. If the member’s progress is uniquely tracked for each period, then Loyalty Program Member Attribute Value records are created for each period.
Mary views the attribute values in the Loyalty Program Member Attribute Values card of the loyalty program member record. Here’s a look at Adria Darby’s attribute values.
- Current Value indicates the value Adria achieved since the last reset. The value resets to 0 after she achieves the target in the period.
- Cumulative Value indicates the value she achieved throughout the period (or the month in this case).
- Target Value indicates the value that Adria must achieve to qualify for the Spend $500, Get a Voucher promotion.
Mary wants to create a second accrual process for engagement activities.
Review the Process for Engagement Activity
Mary follows the instructions shown in Step 2: Create a Process for Purchases to create a process called Credit Points for Activities. She selects Accrual as the journal type and Social Media Activity as the journal subtype. She creates a rule within this process, comprising two Credit Points actions to credit members with Regular Points and Tier Points.
Create a Batch Job
If you recall the rules defined in Step 1, transaction journals related to engagement activities are loaded into Loyalty Management every night. So this process must be executed in batch mode. Mary creates a Batch Management job that processes transaction journals by using the applicable loyalty program process as soon as transactions are loaded.
- Click
, and select Setup.
- Enter
Batch
in the Quick Find box, and select Batch Management.
- Click New and add the following details.
- Name:
Accrual Batch
- Process Type: Loyalty Program Process
- Execution Process: Transaction Journals
- Group:
Loyalty
- Batch Size:
200
- Retry Count:
1
- Retry Interval:
1000
- Click Next and add the following details.
- Object: Transaction Journal
- Select Records When: All Conditions Are Met (AND)
- Resource: Status
- Operator: Equals
- Type: Value
- Value: Pending
- Click Add Condition and add the following details.
Resource
Operator
Type
Value
Journal Type ID
Equals
Value
Accrual
Journal SubType ID
Equals
Value
Social Media Activity
- Click Save.
- Click Activate.
Mary schedules this batch job to run using a flow.
Create a Flow to Schedule the Batch Job
- Click
, and select Setup.
- Enter
Flows
in the Quick Find box, and select Flows.
- Click New Flow.
- Make sure Start From Scratch is selected, and click Next.
- Select Schedule-Triggered Flow.
- Click Create.
- On the Start element, click Set Schedule and add the following details.
- Start Date: Current date
- Start Time: 12:00 AM
- Frequency: Daily
- Click
. Select the Action element.
- Add the following details.
- Search actions: Accrual_Batch
- Label:
Accrual Batch
- API Name:
Accrual_Batch
- Click Save.
- Enter the Flow Label:
Run Batch Job for Accruals
- Click Save.
- Click Activate.
This flow runs the batch job daily, at the scheduled time. Let’s look at how the points are credited and updated when a transaction for social media activity is processed.
Create a Transaction Journal for Social Media Posts
Adria Darby is excited after her recent purchase of Cloud Kicks sneakers. She posts a review about the product on her social media account. Based on the rules Mary set up, Adria is credited with 50 Regular Points and 10 Tier Points. Mary creates a transaction journal to see this in action.
- In the Loyalty Programs tab, select the Cloud Kicks Inner Circle loyalty program.
- In the Cloud Kicks Inner Circle program record, click the Members And Partners tab.
- In the Loyalty Program Members related list, select CL001.
- On the Transaction Journals related list, click New.
- Add the following details.
- Journal Type: Accrual
- Journal Subtype: Social Media Activity
- Activity Date: Current date
- Journal Date: Current date
- Status: Pending
- Loyalty Program: Cloud Kicks Inner Circle
- Click Save.
The transaction journal is saved in the pending state because it’s not processed yet. When the batch job runs as per the schedule, it will process this transaction. Mary, however, wants to test the process to see if it’s working fine.
Run the Flow
Mary runs the Run Batch Job for Accruals flow to process the transaction.
- Click
, and select Setup.
- Enter
Flows
in the Quick Find box, and select Flows.
- From the Flows list view, select Run Batch Job for Accruals.
- Click Debug.
- Deselect Debug pause element behavior.
- Click Run.
The flow triggers the Accrual Batch job. Mary monitors the status of the run on the Monitor Workflow Services page.
After the status of the run changes to Completed, the transaction is processed and the Loyalty Ledgers card is updated with the points. If you don’t see the updated ledgers, refresh the page and check again.
The member’s points are updated as soon as the transaction is processed. Mary is happy with the two accrual processes she has set up.
Conclusion
The promotions have led to a huge spike in the sale of Super Kicks, and the product is almost sold out. Members are happy with the rewards they’ve earned and are taking to social media to post about their experiences.
Mary is pleased with how easily she was able to set up the accrual process. She can continue adding rules to the existing processes or create new processes for different journal types and subtypes. Using Promotion Setup, she can customize the processes to her business requirements. She can also create engagement attributes that track the long-term behavior of members, and reward them for achieving the attribute’s target.
Resources
- Video: Use Loyalty Management Promotion Setup to Reward Members for Purchases
- Salesforce Help: Simulate Transaction Journal Processing by Loyalty Program Processes