Nearest date by condition
The Nearest date by condition robot finds the nearest future date from a source date by a rule: a given day of the week, the first day of next month (first-day), the last day of the month (last-day), or the nearest weekday (next-weekday). It returns the date in YYYY-MM-DD and DD.MM.YYYY formats plus the number of days until it, for Bitrix24 (Alaio) business processes.
The robot computes the nearest matching date right inside a Bitrix24 (Alaio) business process or robot, with no formulas or code. It takes a source date and a condition as input: a day of the week (monday…sunday, localized names are also accepted), first-day for the first day of next month, last-day for the last day of the month, or next-weekday for the nearest workday (skipping Saturday and Sunday). The Include today flag (Y/N) controls whether the source date itself counts as a match. It outputs three fields: the found date in YYYY-MM-DD format, the same date in DD.MM.YYYY format, and the number of days until it. Use it to schedule a task for next Monday, push a payment to the end of the month, assign an activity to the nearest workday, or calculate a reminder date. Plug the result into the date fields of later process steps.
What input parameters does the robot accept?
| Parameter | Type | Required? | Default |
|---|---|---|---|
| Source date | date | yes | |
| Condition: monday/tuesday/wednesday/thursday/friday/saturday/sunday / first-day / last-day / next-weekday | string | yes | |
| Include today if it already matches (Y/N, default N) | string | — |
What does the robot return?
| Parameter | Type |
|---|---|
| Found date (YYYY-MM-DD) | date |
| Found date (DD.MM.YYYY) | string |
| Days until the found date | int |
Scenario: scheduling a task for the nearest Monday
- A new deal is created
- The robot takes the current date and the monday condition
- The task deadline is set to the found Monday, and the number of days until it goes into a notification