Create and Map Benefit Actions
Learning Objectives
After completing this module, you’ll be able to:
- Explain the use of Benefit Actions.
- Create a Benefit Action.
- Run a flow to execute Benefit Actions.
Define Benefit Actions
Remember how Mary wanted to create rewards that would bring in a touch of exclusivity? One such exclusive reward is priority support. When a member upgrades from Silver to Gold tier, they’re entitled to priority support. This benefit requires a downstream action to create a Priority Service Entitlement record in Service Cloud. A Benefit Action creates the record when the benefit is assigned to a member.
Loyalty Management invokes Benefit Actions when a new benefit is assigned to a member. Optionally, depending on the Benefit Action definition, it can be executed when a new benefit is updated or if a benefit no longer applies. For example, when a member retains their tier, the period for the Priority Support benefit must be extended. Or when a member moves to a lower tier, and the Priority Support benefit no longer applies.
Let’s take a closer look at how these actions work.
Create a Benefit Action
Loyalty Management offers the following prebuilt Benefit Action templates for common scenarios.
- Assign Support Entitlement
- Issue Voucher
- Issue Free Product Sample
Linda can either use the templates as a reference for setting up custom Benefit Actions or create them from scratch. For her use case, she uses the Assign Support Entitlement action.
Here’s how Linda creates the Benefit Action.
- Click , and select Setup.
- Enter
Benefit
in the Quick Find box, and select Benefit Actions.
- Click New.
- Select the Assign Support Entitlement template.
- Click Next.
- Click Next.
- Review the details and click Save.
A Benefit Action is executed using a flow. All the template Benefit Actions have accompanying flow templates that you can use. The Assign Support Entitlement Benefit Action uses the Assign Support Entitlement flow definition. Let’s review the flow and understand what it does.
Review the Assign Support Entitlement Template Flow
The Assign Support Entitlement flow creates or updates support entitlement records for a loyalty program member based on the benefit’s eligibility criteria. For example, when a member upgrades from the Silver to the Gold tier, the flow creates an Entitlement record. The Entitlement record ID is saved against the member benefit. When a member retains their tier, the end date of the Support Entitlement record is updated to the tier expiration date. When the benefit no longer applies, the end date of the Support Entitlement record is updated to the end date of the benefit.
Linda reviews the flow on the Flow Builder page.
You can create a copy of the template and customize it to your business requirement. Linda doesn’t require any customizations so she leaves it as is.
Linda’s created the Assign Support Entitlement Benefit Action. But it must run when a member’s tier changes and the member is assigned the benefit. For this to happen, she must create a flow.
Create a Flow
Linda creates a flow named Assign and Process Member Benefits Based on Tier, which determines the benefits that must be assigned to a member and executes the Assign Support Entitlement Benefit Action. This flow has already been created in your special Developer Edition org. To review the flow, navigate to Setup | Flows | Assign and Process Member Benefits Based on Tier.
Let’s understand what each action in the flow does.
Get Records
This action finds records of the Loyalty Member Tier object.
Assign Member Benefits
This action creates, updates, or expires records in the Member Benefits table. Based on the tiers associated with member benefits that include a defined Benefit Action, the flow action determines the benefits that must be assigned. It resolves any conflict in the benefits assignment based on the Priority Sequence. It calculates the start date and end date of the benefit, and it updates the status of the member benefit records.
Loop
This action creates a loop path, and for each iteration, the flow temporarily stores the item in a loop variable.
Process Member Benefit Action
This action executes the Benefit Action associated with a benefit in a Member Benefit record. It executes the flow associated with a Benefit Action for a specific Member Benefit.
The flow is automatically triggered when a member’s tier changes and the member is assigned new benefits. Next, Linda must create a batch job to process this flow.
Create and Schedule a Batch Job
Batch management creates smaller batches of transactions and passes them through the flow. Linda creates a batch job and then schedules it to run as part of a scheduled flow. This batch job has already been created in your special Developer Edition org. To review the job, navigate to Setup | Batch Management | Batch for Assigning and Processing Tier Benefits.
To schedule the batch job to run daily at a scheduled time, Linda creates another flow named Run Batch Job for Tier Benefits. This flow has already been created in the special Developer Edition org. To review the flow, navigate to Setup | Flows | Run Batch Job for Tier Benefits.
Let’s recap what Linda has done so far.
- She created a Benefit Action using a predefined template, which is associated with an out-of-the-box flow. This flow executes the Benefit Action.
- She then created a flow and an associated batch job for executing Benefit Actions on tier change.
- Lastly, she created a second flow that runs the batch on a set schedule. In a real-world scenario, the batch job can also be used in the tier processing flow to trigger benefits based on tier change.
There’s one more step remaining to complete the setup.
Map Benefit Actions to Benefits
Linda must associate the Benefit Action with the benefits that she’s already created.
- Click , and select Loyalty Management.
- In the Cloud Kicks Inner Circle loyalty program record, click the Experiences tab.
- From the Benefit Types list, select Service Entitlement.
- In the Related tab, click Map Actions.
- Add the following details.
- Benefit Action: Assign_Support_Entitlement
- Entitlement Name:
Priority Support
- Entitlement Process Name:
Loyalty Support Entitlement Process
- Support: Phone Support
- Click Save.
The Benefit Action is successfully mapped to the Priority Support benefit. When a member’s tier changes, the members are assigned the new tier benefits. The flow and batch jobs run to execute any actions associated with a benefit.
Change Member Tier
Linda wants to test if the process is working correctly. She manually adjusts the tier of a loyalty program member, Michelle Smith.
- In the Loyalty Programs tab, select the Cloud Kicks Inner Circle loyalty program.
- In the Cloud Kicks Inner Circle loyalty program record, click the Members And Partners tab.
- In the Loyalty Program Members related list, select CL003.
- Click the Quick Actions menu and select Change Member Tier.
- Provide the following details.
- Tier Group: Inner Circle Tier Group
- New Tier: Gold
- Change Reason: Resolve Tier Conflict
- Comments:
Change tier
- Click Change.
Linda reviews Michelle’s benefits using the View Member Benefits quick action and sees that all benefits related to the Gold tier are applied. However, she needs to run the Run Batch Job for Tier Benefits flow to process the Benefit Actions.
Debug the Flow
Linda runs the Run Batch Job for Tier Benefits flow to process the benefits.
- Click , and select Setup.
- Enter
Flows
in the Quick Find box, and select Flows.
- From the Flows list view, select Run Batch Job for Tier Benefits.
- Click Debug.
- Disable Debug pause element behavior.
- Click Run.
The flow triggers the Batch for Assigning and Processing Tier Benefits job. To monitor the status of the run, she navigates to Setup | Monitor Workflow Services.
After the status of the run changes to Completed, Linda navigates to the Entitlements record to verify that a record has been created.
She’s happy to see the process working as per Mary’s requirements and gives Mary a demo.
In Conclusion
Mary’s excited to see her vision come to life. The tier benefits along with the added dynamic benefits give the program a touch of exclusivity. She sees the impact it has on the engagement and decides to add more diverse and unique benefits. Benefits are a great way to keep members engaged and show them that you care. Use Benefit Actions to create unique dynamic rewards that can trigger processes across clouds or trigger actions within Loyalty Management.