goNext
The vcc.goNext function is used to programmatically navigate the agent to the next sequential tab (or page) within the VCC Live script interface. This is typically used to streamline the agent’s experience by automatically advancing them through a multi-page script questionnaire once specific conditions are met or actions are completed, reducing manual clicks.
Description
vcc.goNext([nextPage: string]): void
Parameters
nextPage
Optional. The name of the next page to jump to. If missing, it triggers the same action as clicking the Next button.
Return values
This function does not return a value (undefined).
Use cases with explanation
Use case 1. Auto-advancing after successful data validation
You can use vcc.goNext() to automatically push the agent to the next script page once a critical field has been validated. This guarantees that agents do not proceed until the required information is correctly filled, while saving them a click when it is.
$("compliance_section", "identity_number").afterSetData = function() {
// If the collected identity number is exactly 8 characters long, it's valid.
if (identity_number && identity_number.length === 8) {
// Automatically jump to the next tab
vcc.goNext();
return true;
} else {
// Block navigation and warn the agent
alert("Please enter a valid 8-digit identity number before proceeding.");
return false;
}
};
2. Custom “Next” button logic
Instead of relying purely on default script controls, you can bind vcc.goNext() to a custom button’s click event. This might be used when an agent confirms they have read a compliance statement to the customer.
$("compliance_section", "btn_confirm_read").afterSetData = function() {
// When the agent clicks the 'Confirm' button, indicating they read the compliance statement,
// we log an internal variable and automatically advance to the next tab.
vcc.setFieldValue("compliance_read", "Yes");
vcc.goNext();
};
3. Skipping past unnecessary pages based on IVR
If the customer has already authenticated themselves in the IVR before the agent receives the call, you might want to immediately skip the “Agent Authentication” first page and go to the next page.
$().onLoad = function() {
// Check if the IVR successfully authenticated the caller
var isIvrAuthenticated = vcc.getChannelVariable("ivr_auth_success");
if (isIvrAuthenticated === "true") {
// Skip the manual ID check page and go to the next logical step
vcc.goNext();
}
};
Notes
- If the agent is already on the final tab/page of the script, calling
vcc.goNext()will generally have no effect. - Using
vcc.goNext()is ideal for linear workflows. If your script logic is highly nonlinear or requires branching paths, consider usingvcc.goTab(tabId)instead to explicitly jump to specific named tabs. - Ensure that you don’t create infinite loops by coupling
vcc.goNext()directly to an unconditionalonLoadhook without any breaking conditions.
Comments
Can’t find what you need? Use the comment section below to connect with others, get answers from our experts, or share your ideas with us.
There are no comments yet.