For example, admins of an airline can set up a batch job to credit points to loyalty program members based on the class of ticket purchased or promotion.
Required Editions
| Available in: Lightning Experience in Enterprise, Performance, Developer, and Unlimited Editions that have Loyalty Management enabled. |
Let’s say members of the Corporate Loyalty program who purchase an economy class ticket are credited with 300 non-qualifying points. Members who purchase business class tickets are credited 500 non-qualifying points.
- From Setup, in the Quick Find box, enter Flows, and then select Flows.
- Click New Flow.
- Select Autolaunched Flow (No Trigger), and click Next.
- Click +.
-
Select Get Records and provide these details.
- Label: Get Transaction Journals
- Object: Transaction Journal
- Condition Requirements: All Conditions Are Met
- Field: Id
- Operator: Equals
- Value: Create a Variable type resource, and select the data type as Text. Name the variable as RecordID, and make it available as an input outside the flow.This input variable helps the batch job identify each unique record that it must process.
- Click Done | Done.
- Click +.
-
Select Decision and provide these details.
- Define the decision for the economy class ticket purchases:
- Label: Economy Class
- When to Execute Outcome: All Conditions Are Met
- Condition Requirements:
- Resource:{!Get_Transaction_Journals.BookedFareClass}
- Operator: Equals
- Value: Economy
- Add another outcome.
- Define the decision for the business class ticket purchases:
- Resource: {!Get_Transaction_Journals.BookedFareClass}
- Operator: Equals
- Value: Business
- Define the decision for the economy class ticket purchases:
- Click Done.
- Click +.
- Select Action.
-
Search and select Credit Points, and provide these details:
Field Value Label Credit Points for Economy Class Program Corporate Loyalty Program Currency Type Points Recipient Member ID {!Get_Transaction_Journals.Member.Id} Number of Points to Credit 300 Journal ID {!Get_Transaction_Journals.Id} Promotion ID Double Points - Click Done.
- Click +.
- Select Action.
-
Search and select Credit Points, and provide these details:
Field Value Label Credit Points for Business Class Program Corporate Loyalty Program Currency Type Points Recipient Member ID {!Get_Transaction_Journals.Member.Id} Number of Points to Credit 500 Journal ID {!Get_Transaction_Journals.Id} Promotion ID Double Points - Click Done.
- Save the changes.
- Name the flow Credit Points to Members, and save the changes.
-
Activate the flow.
Credit Points to Members based on Promotion
Here’s an example, if you want to credit points for members based on a promotion (For example, the promotion criteria: Members age is greater than 20, Interests is Outdoor, and Loyalty Enrollment Channel is Web), you can create a subflow and provide the following input parameters in the flow:Field Value JournalId {!JournalID} MemberId {!Get_Transaction_Journal_ID.MemberId} Date_of_Transaction {Date_of_Transaction} Member_Age {!Member_Age} Member_Interests {!Member_Interests} Member_Enrollment_Channel {!Member_Enrollment_Channel}
Create a batch job that processes this flow.