top of page

Salesforce Flow Reactivity: A Workaround for Date Field Limitations 🔮🪄

Salesforce's flow reactivity is a powerful new feature, but it comes with certain limitations, particularly when referencing date fields in formulas to dynamically display text inputs. This post outlines a workaround to address this challenge.


Business Scenario: Streamlining HR Time-Off Requests

XYZ Solutions uses Salesforce for HR processes. Jenna, an HR manager, needs a formal intake process for time-off requests, including validations for vacation, sick days, and travel & expense requests.


Key requirements for vacation requests:

  • Must be submitted at least 14 business days before the start date

  • Cannot exceed 10 business days in length

  • Exceptions are allowed for family emergencies and other extenuating circustances


Building the Flow: A Step-by-Step Guide

Due to limitations in reactive screen components,dates cannot be reactively calculated in formulas for conditional visibility for text inputs. The following details a workaround to meet the business scenario requirements.


Step 1: Enable Flow Reactivity

For flow versions under API version 59, ensure reactivity is enabled. Navigate to process automation settings and check the corresponding box.


ree

Step 2: Configure Flow Elements


ree

Add Screen Components:

  • Vacation Time Off Requirements Checkbox: This acts as a placeholder and is crucial for the reactivity workaround.


ree

  • Default Value Formula: The default value of this checkbox is determined by a formula that verifies if the start and end dates meet the specified parameters.

ree

  • Conditional Visibility: The text input field and file input component are only visible when the "Vacation Time Off Requirements" checkbox is checked.


ree

Step 3: Testing

  • Test 1: Verify that vacation requests with dates within the parameters are allowed, and that the parameters are only applied to vacation requests.

  • Test 2: Confirm that requests exceeding 10 days are flagged, and that the field reactively recalculates if the employee adjusts the duration to under 10 days.


  • Test 3: Ensure that requests longer than 2 weeks are flagged, and that the field reactively recalculates if the employee adjusts the duration to under 10 days.


Potential Enhancements


Future enhancements for this flow could include:

  • Excluding holidays from business day calculations.

  • Integrating business hours requested and remaining.

 
 
 

Recent Posts

See All

Comments


  • LinkedIn
  • Twitter
Jessica Mills Profile Picture.jpg

About Me

My name is Jessica Mills and I am a Sales Operations Associate at Snap, Inc. I started learning Salesforce when I was 18 years old and a freshman in college. I wouldn't be where I am today without the guidance and support of others. My hope is to help people navigate the Salesforce ecosystem.

 

Read More

 

bottom of page