Skip to main content
Join the Agentforce Hackathon on Nov. 18-19 to compete for a $20,000 Grand Prize. Sign up now. Terms apply.

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.

Note

Optionally, you can complete the steps from this unit in your Developer Edition org for practice, but it's not part of the challenge exercise. This means we won't check whether or not you've completed the steps.

  1. Click Setup, and select Setup.
  2. Enter Benefit in the Quick Find box, and select Benefit Actions.
  3. Click New.
    The New Benefit Action window where you select the Benefit Action.
  1. Select the Assign Support Entitlement template.
  2. Click Next.
    The New Benefit Action window where you review the details of the action.
  1. Click Next.
    The Benefit Action Mapping window where you define the input variable field mappings if required.
  1. 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.

The Flow Builder page where you review the Assign Support Entitlement flow.

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

The Flow Builder page where you review the Assign and Process Member Benefits Based on Tier flow.

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

The Assign and Process Member Benefits Based on Tier batch job where you review the job details.

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

The Flow Builder page where you review the flow

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.

  1. Click App Launcher, and select Loyalty Management.
  2. In the Cloud Kicks Inner Circle loyalty program record, click the Experiences tab.
  3. From the Benefit Types list, select Service Entitlement.
  4. In the Related tab, click Map Actions.
    The Map benefits to actions window where you map the Benefit Actions to the benefit.
  1. Add the following details.
    • Benefit Action: Assign_Support_Entitlement
    • Entitlement Name: Priority Support
    • Entitlement Process Name: Loyalty Support Entitlement Process
    • Support: Phone Support
  1. 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. 

  1. In the Loyalty Programs tab, select the Cloud Kicks Inner Circle loyalty program.
  2. In the Cloud Kicks Inner Circle loyalty program record, click the Members And Partners tab.
  3. In the Loyalty Program Members related list, select CL003.
    The actions associated with a member on the Loyalty Program Member record page.
  1. Click the Quick Actions menu and select Change Member Tier.
    The Change member tier window where you provide details related to tier change.
  1. Provide the following details.
    • Tier Group: Inner Circle Tier Group
    • New Tier: Gold
    • Change Reason: Resolve Tier Conflict
    • Comments: Change tier
  1. 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. 

  1. Click Setup, and select Setup.
  2. Enter Flows in the Quick Find box, and select Flows.
  3. From the Flows list view, select Run Batch Job for Tier Benefits.
  4. Click Debug.
  5. Disable Debug pause element behavior.
  6. 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.

The Monitor Workflow Services page where you view the status of a batch job.

After the status of the run changes to Completed, Linda navigates to the Entitlements record to verify that a record has been created. 

The Entitlements record page where you view the status of the records 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. 

Comparta sus comentarios sobre Trailhead en la Ayuda de Salesforce.

Nos encantaría conocer su experiencia con Trailhead. Ahora puede acceder al nuevo formulario de comentarios cuando quiera desde el sitio de la Ayuda de Salesforce.

Más información Continuar para compartir comentarios