Build a Reactive Budget Tracker with Declarative Flow Builder

Build a Reactive Budget Tracker with Declarative Flow Builder

Salesforce’s Spring ’25 release introduces reactive capabilities in Flow Builder, allowing you to build real-time screen flows that update without writing code. In this example, we’ll create a Reactive Budget Tracker that instantly calculates the remaining budget and percentage spent as users update their Monthly and Current Expenses.

Important:?Before you begin, ensure that your organisation’s?Process Automation Settings enable Reactive Components for Specific Flow Versions. This setting is essential for the reactive formulas to work correctly.

Scenario: Real?Time Expense Monitoring

Imagine a manager or employee entering two key values on a flow screen:

  • Monthly Budget: The total budget allocated for the month.
  • Current Expenses: The amount spent so far.

Using Flow Builder’s reactive formulas, the screen will automatically display:

  • Remaining Budget: Calculated as the Monthly Budget minus Current Expenses.

These instant calculations provide users with real?time insights into spending, enabling them to take immediate action if needed.

Step?by?Step Implementation

1. Enable Reactive Components in Your Org

Before creating your flow:

  • Navigate to Setup in your Salesforce org.
  • Search for Process Automation Settings.
  • Locate and enable Enable Reactive Components for Specific Flow Versions.

This setting is crucial to activating the real?time reactive behaviour in your flows.

2. Create a New Screen Flow

  • Open Flow Builder and create a new Screen Flow.
  • This flow will contain the screen elements for capturing inputs and displaying the reactive calculations.

3. Add Input Components

On your flow screen, add two Number Input fields:

  • Monthly Budget:

  1. Label: “Monthly Budget”
  2. API Name: monthlyBudget
  3. Default Value (optional): 0

  • Current Expenses:

  1. Label: “Current Expenses”
  2. API Name: currentExpenses
  3. Default Value (optional): 0

These input components allow users to provide the budget and expense details.

4. Create Reactive Display Text with Formula

Add a Display Text component to the screen to show the calculated results. In the Display Text editor, include the following formulas:

  • Remaining Budget Formula: {!monthlyBudget} - {!currentExpenses}

Thanks to the reactive behaviour enabled earlier in the Process Automation setting, these formulas will automatically recalculate whenever the user updates the Monthly Budget or Current Expense values.

5. (Optional) Add Conditional Messaging

For enhanced usability, you can add a conditional Display Text component to warn users if their expenses exceed the budget. For example:

  • Warning Message: “Alert: You have exceeded your monthly budget!”
  • Set this component’s visibility to be conditional on the formula {!currentExpenses} > {!monthlyBudget}.

6. Test and Deploy the Flow

  • Save and activate your flow.
  • Run the flow and enter different values for Monthly Budget and Current Expenses.
  • Verify that the Remaining Budget and Percentage Spent update immediately as you modify the inputs.

Benefits of the Reactive Budget Tracker

  • No Code Required: Build interactive, real?time interfaces using Flow Builder’s declarative tools.
  • Instant Feedback: Users see immediate calculations, enabling proactive expense management.
  • Ease of Maintenance: A fully declarative solution is simple to configure and update as business needs evolve.

Conclusion

Salesforce Spring ’25’s enhanced Flow Builder capabilities allow you to deliver real?time business insights through reactive screen flows—without writing code. By enabling the Enable Reactive Components for Specific Flow Versions setting in Process Automation Settings, you unlock the power of reactive formulas, as demonstrated by our Reactive Budget Tracker example. This approach streamlines expense monitoring and empowers users to make timely decisions.

The Salesforce Release Notes provide additional details on reactive components and other Spring ’25 enhancements.

Demo Video

Click on the "Demo Video" to view it in action


要查看或添加评论,请登录

Gella Sangamesh Gupta的更多文章