Automate on an Inspection Appointment Change
The On Appointment Change trigger starts an automation when an inspection appointment is booked, changes status, is rescheduled, or is reassigned. Use it to email the applicant, stamp a date on the permit, or move the permit to its next step when an inspection finishes.
Prerequisites
- You can create automations in the Automation Builder. See Create an Automation.
- The inspection calendar exists and takes bookings. See Inspection Calendars.
- If the automation updates the permit, you know which permit fields it should change.
Steps
Create the automation
In Automation, click Add Automation, give it an Automation Name and Automation Description, and click Create.
Choose the trigger
Click the Select Trigger step and choose On Appointment Change ("Trigger when an appointment changes."). Enter a Name for the trigger.
Add the conditions
Under Appointment Search Conditions, add one row per condition: pick a Condition, an Operator (Equals or Not Equal), and a Value. Use Logic (AND or OR) to combine rows. The conditions are listed below. Click Save Changes.
Add the actions
Click Select Action and add what should happen, for example Send Email or Update Record. In each action you can insert values from the appointment, such as Contact Email, Appointment Date, Inspection Type, Assigned User Name, or Permit Record ID. Click Save Changes on each step.
Test, then activate
Turn on Activate Automation. Book or update a test appointment that matches your conditions and check the automation's run history. See Testing Automations.
Conditions you can use
| Condition | Value |
|---|---|
| Appointment Status | An appointment status (see below) |
| Previous Appointment Status | The status before the change |
| Calendar Id | A calendar, picked from your calendars |
| Appointment Priority | Low, Normal, High, or Urgent |
| Action Source | user (staff) or citizen (applicant) |
| Assigned User Changed | true or false |
| Appointment Date | A date |
Appointment statuses: Scheduled, Confirmed, Unconfirmed, Rescheduled, In Meeting, Running Late, Completed, Cancelled, No Show, Pending Payment, Require Reassignment, Require Reinspection, Require Reschedule.
Status conditions match the change, not the current state
An Appointment Status condition matches when the appointment is first created with that status or when its status changes to that value. A reschedule or reassignment that leaves the status the same does not match a status condition. Use Assigned User Changed or Appointment Date for those.
Values you can use in actions
The trigger provides these values to later steps:
| Group | Values |
|---|---|
| Appointment | Appointment ID, Confirmation Code, New Status, Previous Status, Appointment Priority, Appointment Title, Appointment Date, Previous Appointment Date, Appointment Time, Appointment Start Time, Appointment End Time, Appointment Timezone, No Show Count, Reschedule Count, Reason, Special Notes, Cancelled Date, Cancelled Time |
| Calendar | Calendar ID, Calendar Name |
| Applicant | Contact Full Name, Contact First Name, Contact Last Name, Contact Email, Contact Phone |
| Inspector | Assigned User Name, Assigned User Email, Assigned User Phone No., and the matching Previous Assigned User values |
| Permit and inspection | Permit Number, Permit Record ID, Permit Entity ID, Permit Type, Record Number, Inspection Type, Inspection Type Code, Inspection Location, Tax Map |
Example
When a Building Permit inspection is completed, stamp the date on the permit and email the applicant.
| Setting | Value |
|---|---|
| Automation Name | Building - Inspection completed |
| Trigger | On Appointment Change |
| Condition 1 | Appointment Status Equals Completed |
| Condition 2 (AND) | Calendar Id Equals Building Inspections |
| Action 1 | Update Record on the Building Permit entity, record = Permit Record ID, set Last Inspection Date = Appointment Date |
| Action 2 | Send Email to Contact Email: "Your Inspection Type inspection for permit Permit Number was completed on Appointment Date." |
Common mistakes
- No calendar condition. Without Calendar Id, the automation runs for every calendar in the app, including other departments.
- Using a status condition for reschedules. A reschedule that keeps the status does not match. See the callout above.
- Treating Completed as passed. Completed means the appointment is finished, not that the inspection passed. Read the inspection result on the inspection record before advancing a permit.
- Emailing on every change. A trigger with no conditions runs on every booking, status change, reschedule, and reassignment.