Reservation notification Query examples
Review reservation notification events, AND, OR, search, relative time, and custom-field conditions.
A reservation notification Query selects the moment when one reservation enters its result. The event chooses which data change to inspect. The Query narrows which reservations send an alert. Test both matching and nonmatching synthetic reservations before production use.
Events and entry behavior
| UI event | Value | Notification condition |
|---|---|---|
| New reservation | insert | The new row matches the Query. |
| Reservation update | update | The row did not match before the update and matches after it. |
| Reservation deletion | delete | The row matches immediately before deletion. |
An update rule uses the result boundary. Saving a reservation that already matches does not send a duplicate. Removing a reservation from the result does not send an alert. A later update sends a new alert if the reservation enters the result again.
An empty Query matches every reservation for that event. Add at least one row for production alerts, then verify it with synthetic data.
Fields available in condition rows
| Field | Common use | Common operators |
|---|---|---|
| Reservation status | Separate pending, confirmed, completed, cancelled, and no-show records | eq, neq, in |
| Reservation start | Select upcoming reservations or a time range | eq, gt, gte, lt, lte, in |
| Reservation end | Select an end-time range | eq, gt, gte, lt, lte, in |
| Notes | Match VIP, urgent, campaign, or other text | eq, neq, like, ilike, in |
| Customer ID | Select one customer or a customer list | eq, neq, in |
| Creation time | Select a recent creation range | eq, gt, gte, lt, lte, in |
| Reservation ID | Select one reservation or a reservation list | eq, neq, in |
| Custom field | Select branch, tier, owner, or multiple values | Operators for the field kind |
Reservation custom fields appear in the same field list. Advanced JSON addresses one with
custom.<key>.
Operators
| Operator | Behavior |
|---|---|
eq | Equals the value. |
neq | Does not equal the value. |
gt, gte | Is greater than, or greater than or equal to, the value. |
lt, lte | Is less than, or less than or equal to, the value. |
like | Matches a pattern. % replaces many characters and _ replaces one. |
ilike | Matches a pattern without case sensitivity. |
in | Equals one value from the entered list. |
contains | Requires an array custom field to contain every entered value. |
Add different operators to the same field. For example, gte = now and lt = now+1d on the
reservation start select the next 24 hours. One Query cannot repeat the same field and operator pair.
Useful rules made with condition rows
These examples use synthetic operating scenarios.
| Operating case | Event | Query rows |
|---|---|---|
| Reservation created as confirmed | New reservation | status eq confirmed |
| Pending reservation becomes confirmed | Reservation update | status eq confirmed |
| Reservation with a VIP note | New reservation or update | notes ilike %VIP% |
| Confirmed or completed reservation | Required event | status in confirmed, completed |
| Start within the next 24 hours | Required event | starts_at gte now, starts_at lt now+1d |
| Reservation tagged for app and SMS | Required event | custom.channels contains app, sms |
| Cancelled reservation is deleted | Reservation deletion | status eq cancelled |
Laney combines all condition rows with AND. status eq confirmed with notes ilike %VIP% requires
both conditions.
Relative time
Time fields accept now and an offset in minutes, hours, or days.
| Value | Meaning |
|---|---|
now | Time when Laney inspects the event |
now-30m | 30 minutes before inspection |
now+2h | Two hours after inspection |
now-7d | Seven days before inspection |
now+1d | One day after inspection |
Laney resolves relative time when the reservation event occurs. Time passing does not create a data change event. Use a heartbeat automation when elapsed time alone must find the reservation.
Use OR in advanced JSON
Advanced JSON supports where, or, and search. This example selects a pending or confirmed
reservation when its notes contain urgent or its customer tier is vip.
{
"where": {
"status": { "in": ["pending", "confirmed"] }
},
"or": [
{
"notes": { "ilike": "%urgent%" },
"custom.customer_tier": { "eq": "vip" }
}
]
}Inside one object in the or array, one condition must match. The where object and the or
object must both match.
Combine several OR groups
Several objects in or combine with AND. The next example requires a pending reservation. It also
requires urgent or vip and Gangnam branch or Kakao source.
{
"where": {
"status": { "eq": "pending" }
},
"or": [
{
"notes": { "ilike": "%urgent%" },
"custom.customer_tier": { "eq": "vip" }
},
{
"custom.branch": { "eq": "gangnam" },
"custom.source": { "eq": "kakao" }
}
]
}Do not use in or contains inside or. Put list and array conditions in where. Keep only the
alternative conditions in or.
Combine search and filters
search finds a term in searchable reservation values. Reservation search includes status, notes,
and customer ID. This example requires consultation in a searchable value. It also requires a
pending or confirmed reservation that starts within the next day.
{
"search": "consultation",
"where": {
"status": { "in": ["pending", "confirmed"] },
"starts_at": { "gte": "now", "lt": "now+1d" }
}
}search, where, and every or group all apply together.
Combine custom fields
This example requires the labels custom field to contain both vip and mobile. It also requires
the tier custom field to equal gold.
{
"where": {
"custom.labels": { "contains": ["vip", "mobile"] },
"custom.tier": { "eq": "gold" }
}
}Review custom-field keys and kinds under Custom fields for the current organization. Use
contains for multiple selections. Use like or ilike for text. Use eq, neq, or in for a
single selection or switch value.
Unsupported advanced properties
A reservation notification checks membership for one changed row. It does not support the list
properties embed, order, limit, or offset. Use a regular automation and the
automation Query reference for relationships, sorting, or multi-row reads.
Laney cannot convert advanced JSON with OR or search back into condition rows without losing data. Keep editing and saving that rule in advanced JSON mode.