Accessing web chat welcome screen variables in a flow


If a Zoom Contact Center admin configured a chat campaign and customized the web chat welcome screen with fields, these consumer-entered values are stored to global variables so they can be referenced in the flow.

Prerequisites for accessing web chat welcome screen variables in a flow

How to access web chat welcome screen variables in a flow

  1. Create a campaign with the Web Chat type selected.
  2. Customize the engagement welcome screen with one or more fields. For example, First name and Last name.

When consumers join the web chat engagement and enter values for the fields, these are stored to the following global variables:

Welcome screen fieldGlobal system variable
First Nameglobal_system.Consumer.firstName
Last Name global_system.Consumer.lastName
Nickname global_system.Consumer.preferredName
Email global_system.Consumer.email
Phone Numberglobal_system.Consumer.phoneNumber1
Language global_system.Consumer.language
Address 
global_system.Consumer.fullAddress
Company 
global_system.Consumer.company

 

Example

Note: This section shows an example configuration and is not meant to be a complete configuration guide.

Flow layout

Script widget

async function main () {
 
    let payload={
      "global_system.Consumer.firstName": var_get()["global_system.Consumer.firstName"],
      "global_system.Consumer.lastName": var_get()["global_system.Consumer.lastName"],
      "global_system.Consumer.preferredName": var_get()["global_system.Consumer.preferredName"],
      "global_system.Consumer.phoneNumber1": var_get()["global_system.Consumer.phoneNumber1"],
      "global_system.Consumer.company": var_get()["global_system.Consumer.company"],
      "global_system.Consumer.fullAddress": var_get()["global_system.Consumer.fullAddress"],
      "global_system.Consumer.email": var_get()["global_system.Consumer.email"],
      "global_system.Consumer.language": var_get()["global_system.Consumer.language"],
      "global_system.Engagement.engagementId": var_get()["global_system.Engagement.engagementId"],
    }
    
    
  	const result = await req.post('https://api.example.com', payload);
    
    let jsonResponseBody = result.data;
    log.debug("Axios jsonResponseBody=" + JSON.stringify(jsonResponseBody));
}