# Appointment Management

{% hint style="info" %}
*Use this template to efficiently **manage appointment and account-related queries** along with escalations to live agents without leaving the conversation in both **inbound and outbound** scenarios.*
{% endhint %}

To use this template, simply choose it from the templates page when you create a new agent. You can then make changes to customize it based on your business needs.

<figure><img src="https://3877181490-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_81A0PNZfdawu_TPAO%2Fuploads%2Fqehbd7SkDRlgv3xCAGjW%2FScreenshot%202023-08-21%20at%205.25.05%20PM.png?alt=media&#x26;token=34e76f56-8704-485e-92f9-a5ef92593099" alt=""><figcaption></figcaption></figure>

## Flow Overview

**Collection and Classification of User Intent**

This template covers various actions under the following topics: **Appointment management**, **Account management**, **Address information**, **Appointment Reminders** and **Live Agent Handover.**

<figure><img src="https://3877181490-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_81A0PNZfdawu_TPAO%2Fuploads%2Ff2yhTYaPjDaB4Zl94epW%2FAMtopics.gif?alt=media&#x26;token=2c523d78-c9b0-4755-a796-a2e85752f3b0" alt=""><figcaption></figcaption></figure>

Additionally, different flows are accessible depending on whether the conversation is Inbound or Outbound.

The Inbound flow starts with a check of working hours using a [<mark style="color:purple;">Conditions</mark>](https://studio.docs.ai.vonage.com/whatsapp/nodes/conversation/conditions) node. By default, working hours are set to between Monday to Friday, 8 am to 8:30 pm.&#x20;

Next using a text-based [<mark style="color:purple;">Collect Input</mark>](https://studio.docs.ai.vonage.com/whatsapp/nodes/conversation/collect-input) node, the user is asked what they need help with. This then leads to a sub-flow with all four topics and their subtopics mentioned above

## **Flow Explanation**

The following flows are available for **Inbound Calls**:-

### ***Appointment Management***

This template is built to handle the following actions: **Scheduling, Rescheduling and Cancelling** appointments.

These flows first authenticate your user using the verification flow, before asking for further information.

{% hint style="info" %}
***Verification Flow:** This flow consists of an email and phone number check which integrates into SalesForce to see if a user is verified. In case of verification failure, the flow is then escalated to a live agent using the* [*<mark style="color:purple;">Live Agent Routing Node</mark>*](https://studio.docs.ai.vonage.com/whatsapp/nodes/actions/live-agent-routing)*<mark style="color:purple;">.</mark>*
{% endhint %}

**Scheduling Flow**: Depending on whether the user is verified or not, the flow is slightly altered.&#x20;

<figure><img src="https://3877181490-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_81A0PNZfdawu_TPAO%2Fuploads%2F3tL42s9fl0EsmCTng7aB%2FAMSchedule.gif?alt=media&#x26;token=abe1345e-4228-46d7-bc51-1f65f1288d87" alt=""><figcaption></figcaption></figure>

* For **Verified users**, the Virtual Assistant (VA), first asks the user what service they require (which by default is displayed via [<mark style="color:purple;">Reply Buttons</mark>](https://studio.docs.ai.vonage.com/whatsapp/nodes/conversation/collect-input#reply-buttons)), then asks them to select a Physician (which by default is set up using [<mark style="color:purple;">List Messages</mark>](https://studio.docs.ai.vonage.com/whatsapp/nodes/conversation/collect-input#list-messages)).&#x20;
* Next, using a [<mark style="color:purple;">SalesForce Action Node</mark>](https://studio.docs.ai.vonage.com/whatsapp/nodes/integrations/salesforce-actions), the VA does a check of available dates.
* Depending on the response from Salesforce (which is categorized using a [<mark style="color:purple;">Conditions Node</mark>](https://studio.docs.ai.vonage.com/whatsapp/nodes/conversation/conditions)), the flow then branches out into two smaller flows.
* If available dates are returned from SalesForce, the VA then presents these to the user and asks them to make a selection. This is then followed by another [<mark style="color:purple;">SalesForce Action Node</mark>](https://studio.docs.ai.vonage.com/whatsapp/nodes/integrations/salesforce-actions) that retrieves available times. The available time list is then presented to the user, after which the user has the ability to either, change one of the previously selected parameters (Physician, date or time) or choose one of the available times.&#x20;
* If the user chooses one of the available time slots, the VA logs their request into Salesforce and provides them with a confirmation number. If the user chooses to change any of the collected parameters, the flow then routes them back to the specified part in the flow that handles the parameter they want to edit.
* If there are no available dates returned, the VA asks the user to retry and re-enter a different service and physician to retry the query to receive available dates.
* For **Unverified users**, the VA lets the user know that they need to create an account to schedule an appointment and allows them to create a new account by collecting their name, email address, and phone number preference before logging a request on SalesForce.

**Rescheduling Flow:** Requires the user to be verified. If they are not verified, the VA falls back into the Verification Flow.

<figure><img src="https://3877181490-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_81A0PNZfdawu_TPAO%2Fuploads%2F9s0ExkIfB0M92Wh7XF09%2FAMReschedule.gif?alt=media&#x26;token=fb622372-5afd-42e1-9bb1-546e293819d9" alt=""><figcaption></figcaption></figure>

* The flow begins with a SalesForce check of the user's scheduled appointments. The VA then confirms the appointment time, date and physician with the user and asks them if they want to change the time or the date.&#x20;
* The VA then looks for new times/dates as per the user's request and provides a list of available options, allowing the user to pick from them. Once this is done a request is logged into SalesForce and the user receives confirmation of the change.

**Cancellation Flow:** Requires the user to be verified. If they are notverified, the VA falls back into the Verification Flow.

<figure><img src="https://3877181490-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_81A0PNZfdawu_TPAO%2Fuploads%2FqsFL0QH824BsT6q6ILwo%2FScreen%20Recording%202023-08-24%20at%201.42.51%20AM.gif?alt=media&#x26;token=3fbd7574-83be-43ca-8d0a-bf55ac8dc27d" alt=""><figcaption></figcaption></figure>

* The flow begins with a SalesForce check of the user's scheduled appointments. The VA then confirms the appointment time, date and physician with the user.
* The VA then confirms with the user if they want to go ahead with the cancellation. If an affirmative response is received from the user, the VA logs the request on SalesForce and confirms the cancellation with the user. Otherwise, the flow moves on to ask the user what else they need help with.

### ***Account Management***

This flow consists of the following options: **Create an Account**, **Update Personal Data** and **Address Management**.

**Create an Account:** This flow interlinks with a few other flows on this template.

<figure><img src="https://3877181490-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_81A0PNZfdawu_TPAO%2Fuploads%2FYkBCbwC5eXCoeg3OV2Wy%2FScreen%20Recording%202023-08-24%20at%201.44.22%20AM.gif?alt=media&#x26;token=00a4cd58-a7fb-4fa4-8796-31547986f2ef" alt=""><figcaption></figcaption></figure>

* This flow allows users to create a new account by collecting their name, email address, and phone number preferences before logging a request on SalesForce.

**Update Personal Data:** This flow requires mandatory verification before use.

<figure><img src="https://3877181490-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_81A0PNZfdawu_TPAO%2Fuploads%2FUzJsScBOk1Qu0b2DkjrL%2FScreen%20Recording%202023-08-24%20at%201.56.05%20AM.gif?alt=media&#x26;token=a7782b03-77d3-4b26-826d-6f4254a2c151" alt=""><figcaption></figcaption></figure>

* Post verification, this flow allows your users to update either their phone number or email and logs a request on SalesForce before providing a confirmation to the user of the updated detail.

**Address Management:** This flow requires mandatory verification before use.

<figure><img src="https://3877181490-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_81A0PNZfdawu_TPAO%2Fuploads%2FPfy4iyvFecQPGqcTpHrG%2FScreen%20Recording%202023-08-24%20at%201.57.20%20AM.gif?alt=media&#x26;token=2c6ad973-63db-410e-8e3e-a8041a69ccba" alt=""><figcaption></figcaption></figure>

* Post verification, this flow allows your users to choose from either editing an existing address or adding a new one.
* Both flows lead to the collection of the update which is then logged onto SalesForce before confirmation with the user.

### ***Appointment Address***

This flow only has one subfunction: **Appointment Location**

This flow requires mandatory verification before execution.

<figure><img src="https://3877181490-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_81A0PNZfdawu_TPAO%2Fuploads%2FSC45kffJkF4twb0xHW6w%2FScreen%20Recording%202023-08-24%20at%202.09.19%20AM.gif?alt=media&#x26;token=00511bf0-d8c7-46e7-96b9-2a3790db3919" alt=""><figcaption></figcaption></figure>

Post verification, a [<mark style="color:purple;">SalesForce Action Node</mark>](https://studio.docs.ai.vonage.com/whatsapp/nodes/integrations/salesforce-actions) checks to see if the user has scheduled appointments.&#x20;

If a booking ID was retrieved, the VA asks the customer to confirm the booking ID. The VA then checks to see if the booking ID provided by the user is the same as the one retrieved from SalesForce, if so it provides the location for the appointment, or else it provides the user with a retry.&#x20;

If no booking ID was retrieved from SalesForce, the VA lets the user know that there aren't any scheduled appointments and takes the user down the Schedule appointment flow.

### ***Talk to someone***

Users can also choose to speak to a live agent from the main menu. This is accomplished using the [<mark style="color:purple;">Live Agent Routing Node</mark>](https://studio.docs.ai.vonage.com/whatsapp/nodes/actions/live-agent-routing)<mark style="color:purple;">.</mark>

<figure><img src="https://3877181490-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_81A0PNZfdawu_TPAO%2Fuploads%2Fd0JbeiscIuXAtrtBH9c8%2FScreen%20Recording%202023-08-24%20at%202.20.48%20AM.gif?alt=media&#x26;token=d9b0c4fa-5de1-4ee0-a9b5-ef4be7085849" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
*You have the ability to test all the different outcomes of the*[ *<mark style="color:purple;">Live Agent Routing Node</mark>*](https://studio.docs.ai.vonage.com/whatsapp/nodes/actions/live-agent-routing) *before you set it up using the options in the Tester!*
{% endhint %}

All of these inbound flows also include a [<mark style="color:purple;">Context Switch</mark>](https://studio.docs.ai.vonage.com/whatsapp/nodes/flow-control/context-switch) to either go back to the main menu or Route to a human.

**Outbound sessions** have access to the following flow:-

### *Appointment Reminders*

The flow begins with a check using a [<mark style="color:purple;">SalesForce Action Node</mark>](https://studio.docs.ai.vonage.com/whatsapp/nodes/integrations/salesforce-actions) to retrieve information about an upcoming appointment. The first message that goes out to the user states the appointment information and asks the user to confirm the appointment.

<figure><img src="https://3877181490-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_81A0PNZfdawu_TPAO%2Fuploads%2F50ty2E4ZGykEek37Fjlr%2FScreenshot%202023-08-24%20at%202.12.57%20AM.png?alt=media&#x26;token=0fb5babd-5424-4e22-9e91-c7738c16fa66" alt=""><figcaption></figcaption></figure>

If the user confirms, a request is logged in SalesForce and the agent thanks the user before checking to see if the user needs help with anything else (if the user requires more help, the inbound flows are then accessed).

If the user does not confirm the appointment, the VA asks the user if they want to either cancel or reschedule the appointment.&#x20;

Rescheduling allows for either a date or time change which is logged into SalesForce.

Cancellation prompts the VA to confirm the cancellation from the user. If the user agrees a request is sent to SalesForce and the appointment is cancelled before the VA confirms the cancellation. If the user decides not to cancel, the VA then asks the user if it can help with anything else (if the user requires more help, the inbound flows are then accessed).

This flow includes a [<mark style="color:purple;">Context Switch</mark>](https://studio.docs.ai.vonage.com/whatsapp/nodes/flow-control/context-switch) to Route to a human.
