MONTH
Use the MONTH function to return the month from a Date or Date/Time. The month is given as a number ranging from 1 to 12.
Use
MONTH( date )
Returns the month of a date or date/time value.
| Parameter | Required | Description |
|---|---|---|
| date | Yes | the date or date/time that contains the month to return |
| Returns | Number |
Examples
Output Validation (Restricting Submission Periods)
You can use the MONTH function within an Output Validation Formula to ensure a user only submits requests during permitted months of the year.
- Scenario: A company only allows "Annual Bonus" requests to be submitted during the month of March.
- Formula:
ASSERT(MONTH(this) = 3, "Bonus requests can only be submitted for the month of March."). - Logic:
this: Refers to the date the user has entered into the capture widget on the form.MONTH(this): Extracts the numerical month from that date.ASSERT: If the result is not 3 (March), the function returns FALSE and displays the error message, preventing the user from submitting the form.
Path Condition (Year-End Routing)
In the Flow Builder, you can use the MONTH function in a Path Condition Formula to route an approval differently based on the time of year the process started.
- Scenario: A "Financial Review" workflow needs to follow a specialized "Year-End Audit" path if the approval is started in December, but follow the "Standard Review" path otherwise.
- Formula (for the Year-End Path):
MONTH(@prop.StartedOn) = 12. - Logic:
@prop.StartedOn: This system property automatically captures the exact Date/Time the approval run was initiated.MONTH(...): Strips away the day, year, and time information to look only at the month number.- Result: If the run started on December 15th, the formula returns TRUE, and the approval is routed to the audit team.
Pro Tip: If you are working with a date that is currently stored as Text (e.g., "31/01/2024"), you must first use the DATEVALUE function to convert it into a Date data type before the MONTH function can recognize it.