Friday, July 12, 2019

Create a Scheduled Workflow Action that Gets Triggered Only on Weekdays

The TO_CHAR({today}, 'D') formula, returns the day of the week as a number. Sunday is number 1 and Saturday number 7. When the formula below is added to a Scheduled Workflow Action condition, the action will only trigger if the number of the day is different from 1 AND 7.

Formula: TO_CHAR({today}, 'D') != '1' and TO_CHAR({today}, 'D') != '7'

The steps below show how to create a Scheduled Set Field Value action that will execute Monday to Friday at 4am:

1. In a workflow state, click New Action.
2. Select Set Field Value.
3. Under Basic Information:

  • In the Trigger On Field, select Scheduled.

4. Under Parameters:

  • In the Field field, select the field that needs to have the value set.
  • In the Value box, select the value of the field.

5. Under Condition:

  • Check Custom Formula.
  • In the Formula field, enter TO_CHAR({today}, 'D') != '1' and TO_CHAR({today}, 'D') != '7'

6. Under Schedule:

  • Check Time of Day.
  • In the Start Time field, select 4:00 am.
  • In the Unit field, select Day.

7. Click Save.

*Note, please test thoroughly when used across multiple timezones.

No comments:

Post a Comment