Saving Appointment Information
Last updated
Was this helpful?
Last updated
Was this helpful?
In Part III, we built the Availability Schedule designating when appointments were available for selection. Now, we will tie it to the Scheduler Control in order to save the selected appointments and let users know that they were successfully selected.
In AirData Builder, we will create an object to store the scheduled appointments.
Select Add Schedule and rename it to “Appointment Information”.
Save the app and confirm all changes this will make to the Datastore.
Go to Web Flows Builder. Navigate to the Schedule Appointment Web Page and add a Label indicating the users that appointments are in PST.
Inspect the Scheduler Control. Under in Control Properties > Calendar Restriction, add the following Availability Schedule Key:
This references an out-of-the-box Availability Schedule that encompasses all the times that California/Los Angeles TCPA regulations allow automated messages to be sent within. This accounts for local holidays, so when we reference this Availability Schedule as the Calendar Restriction, it prevents appointments from being made on these local holidays (as well as Sundays).
📘 Availability Schedule Keys are found the in Schedules Builder, when Inspecting the Availability Schedule in question. You actually designated you own Availability Schedule Keys in the Part III of this tutorial! Also, adjust the Maximum Days Out to fit our 30-day display of the calendar, and change Minimum Days Out to 2, preventing anyone from making a same-day or next-day appointment:
Under Calendar, select “9 to 5 all days but Friday”. Under Schedule Data Object, select “Appointment Information”.
Tying the Scheduler Web Control to a Schedule Object automatically saves the information associated with selected appointments to AirData. Often, however, it is necessary to save this information more locally as well, so as to be able to reference it more seamlessly in the downstream Journey. To this end, we'll create a global variable to store appointment information locally.
Open the Variables Tree by clicking the Variables button at the bottom left of the Studio. Create a global variable of type object
that matches the structure of Appointment Information. Name this variable appointment
.
Back In Web Flows Builder, with the Scheduler Control selected, go to the Actions tab in the Inspector and add a Set Variable Action passing defining the newly-made global variable session.appointment
as value
.
Add a Navigate to Web Page Action so that once an appointment time is selected, users are led to a Web Page the confirms their appointment time. Click on Add Web Page to do so:
Go to the new Web Page and rename it to “Thank You”. Then add two Labels. In the first one, type the message to the user, for example: "Thank you for scheduling your appointment!"
In the second one, enter the following appointment confirmation string:
You've now finalized the Scheduler Web Control so that it saves the information associated with each selected appointment, both in AirData and locally. You've also used that information to customize the copy associated with a Label.
Save your progress and get ready to schedule some Notifications to send based on each user's selected appointment time.
A Schedule Object is a type of App Object with a pre-defined structure intended to capture all relevant information pertaining to a scheduled appointment. Schedule Objects are used in tandem with a ; when a Schedule Object is associated with a Scheduler, all relevant information collected by users from the Scheduler will be automatically inserted into that Schedule Object in AirData.
For more on Schedules Objects, see .
For more on Control Events, see .
This string confirms the selected appointment time by referencing the DateTime
saved as session.appointment.start_time
. It also utilizes the Airscript function in tandem with the previously-set variable actor.time_zone
to display the appointment time in the user's own timezone.