We would like to send an email via SugarBPM only if today is a weekday

We have a requirement to only send a notification if the date is a weekday. If it is not a weekday wait 1 day and try again. 

How can I add a check to see if today is a weekday?

  • Hi ,

    I don't think there is a way to meet this requirement in SugarBPM directly. You could potentially solve this with 1 or more custom fields. 

    There is a Sugar Logic function dayofweek that returns a numeric value (e.g Sunday = 0, Monday = 1, Tuesday = 2, etc.) for a given date parameter. You could use that function in combination with the today function and some additional logic checks to determine whether it is a weekday:

    and(greaterThan(dayofweek(today()),0),not(greaterThan(dayofweek(today()),5)))

    If your process definition is working on wait timers (i.e. the notification may be sent 1 or more days after the definition is triggered), you would need to create an action to save the record (e.g. update a hidden checkbox on the record to trigger the recalculation) before the gateway evaluating whether it is a weekday or not. Then, once the gateway concludes, reset the hidden field to an empty value. 

    Chris