3/4

isBetween: inside the booking window

Medium

A booking is valid when its date falls strictly between the window's first and last day. Return true when ri!booking is inside the window described by ri!opens and ri!closes.

The opening and closing dates are themselves outside the window. A booking with no date yet is not valid.

Inputs

  • ri!booking — Date
  • ri!opens — Date
  • ri!closes — Date

ri! Rule Inputs

ri!bookingDate
date(2026, 3, 15)
ri!opensDate
date(2026, 3, 1)
ri!closesDate
date(2026, 3, 31)

Example 1 — Mid-window

Input: ri!booking
date(2026, 3, 15)
Input: ri!opens
date(2026, 3, 1)
Input: ri!closes
date(2026, 3, 31)
Output:
true

Example 2 — On the opening day

Input: ri!booking
date(2026, 3, 1)
Input: ri!opens
date(2026, 3, 1)
Input: ri!closes
date(2026, 3, 31)
Output:
false

Example 3 — On the closing day

Input: ri!booking
date(2026, 3, 31)
Input: ri!opens
date(2026, 3, 1)
Input: ri!closes
date(2026, 3, 31)
Output:
false

Example 4 — Before the window opens

Input: ri!booking
date(2026, 2, 20)
Input: ri!opens
date(2026, 3, 1)
Input: ri!closes
date(2026, 3, 31)
Output:
false

Example 5 — Across a year end

Input: ri!booking
date(2027, 1, 2)
Input: ri!opens
date(2026, 12, 28)
Input: ri!closes
date(2027, 1, 5)
Output:
true

Example 6 — No date entered

Input: ri!booking
null
Input: ri!opens
date(2026, 3, 1)
Input: ri!closes
date(2026, 3, 31)
Output:
false

Appian Expression Tips

  • • Use ri!variableName for rule inputs
  • • Use a!localVariables(local!x: …, body) for locals
  • • Use a!forEach(items: …, expression: fv!item) to iterate
  • • Use where() / reject(fn!isnull, list) to filter