• Chris

Calculate Business Hours Diff In Flow Builder

Updated: Mar 20

Effective key performance indicators are a valuable part of any business. However, Salesforce does not have an easy declarative way to do calculations around business hours. You can do this with a variety of formula fields, but it is not very flexible.


For example, how do you quickly update it for a snow day, or your leadership team approved an extra holiday over the winter break? At my organization, we wanted to track performance indicators such as how long does it take to make our first attempt and how long does it take to make the first contact.


This new flow action will allow you to quickly and easily calculate the business hours between two dates. This utilizes the Salesforce built-in Business Hours object. The component has three inputs:

  • Business Hours Id

  • Start Date

  • End Date

You will have the option to output the difference in milliseconds, seconds, or minutes.


Enjoy this action!


Installation

  1. Production

  2. Sandbox

  3. Source

Coming Soon

  1. A flow action to determine if a date is within business hours

  2. A flow action to determine the next business date for a given date

  3. A flow action to add an interval of time from a start Datetime traversing business hours only.

Resources

  1. Guidelines for Setting Business Hours

  2. BusinessHours Class