Evaluating max/min of multiple date fields in flow
UPDATE : JUNE 2023
Summer22 brought us new formula functions.
UNIXTIMESTAMP allows you to convert dates to numbers, which can be fed into MAX or MIN, which will return a single value which you can convert back to dates using FROMUNIXTIME
see the list of formula functions in the docs for details
I have 3 date fields on an object and i need the MIN of the 3. But the MIN formula function does not allow dates, just numbers
IF could work for up to 3, and there are some solutions out there using formulas, but seemed fragile / complex.
So, solved via flow
create a variable, type = date; name it vaMinimumDate
use an assignment element to add all the date fields from the object to a collection variable (doesnt matter if the dates are null or not)
loop over the collection variable
in the loop, use a decision to evaluate if the current loop variable is less than vaMinimumDate
Screensh...

