Enum Events List


How can I write a rule for “Time” so that the event is not scheduled simultaneously and on the same day if I add a new event?

Solved Solved
0 26 835
1 ACCEPTED SOLUTION

You’ll need to use a Valid If expression for the Time column that constructs the list of available time slots. To do so, start with the list of all time slots, then remove the list of unavailable slots, leaving only the available slots:

(
  LIST(
    "07:00:00",
    "08:00:00",
    "09:00:00",
    "10:00:00",
    "11:00:00",
    "12:00:00"
  )
  - SELECT(
    table[Time],
    ([Date] = [_THISROW].[Date])
  )
)

Unfortunately, there’s no way for the expression to know what Enum values are defined, so you’ll have to reproduce that list of values in the expression itself as shown above. Strictly speaking, you probably then don’t even need to define the Enum values, or even use the Enum column type at all–you could just go with a Time column type.

The list of unavailable time slots is gathered using a SELECT() expression to query the table. Note that in the expression above, you need to replace table with the name of the table.

List subtraction is used to remove the unavailable slots from the list of all slots.

See also:




View solution in original post

26 REPLIES 26
Top Labels in this Space