Implementing Data Table Lookups for Dynamic Business Hour Routing
Executive Summary & Architectural Context
Hardcoding business hours, holiday schedules, and emergency overrides directly into an Architect flow using “Schedule Groups” is a beginner anti-pattern. While it works for a single small clinic, it becomes completely unmanageable for an enterprise with 50 different toll-free numbers, each representing a different regional office with its own unique operating hours, local holidays, and emergency closures.
The architectural standard for dynamic routing in Genesys Cloud is Data Table Driven Routing. By abstracting the routing configuration out of the call flow and into a Genesys Cloud Data Table, administrators can instantly toggle emergency statuses, alter business hour mappings, or change target queues without ever opening or republishing the Architect flow.
This masterclass details how to architect a universal “Front Door” Inbound Call Flow that uses the dialed number (DNIS) to query a Data Table, determine the specific office’s open/closed/emergency status in real-time, and route the call accordingly.
Prerequisites, Roles & Licensing
- Licensing: Available on all Genesys Cloud CX tiers.
- Roles & Permissions:
Architect > DataTable > Add/EditArchitect > Flow > Edit
- Platform Dependencies:
- Multiple DNIS (Dialed Number Identification Service) numbers mapped to a single Inbound Call Flow.
The Implementation Deep-Dive
1. Constructing the Routing Data Table
The Data Table acts as the central brain for your routing logic.
- Navigate to Architect > Data Tables and create a new table named
DT_Regional_Routing. - Define the Reference Key (the column used to search the table). Set this to
DNIS_Number(String). - Add the following Custom Columns:
Office_Name(String) - e.g., “Chicago Branch”Schedule_Group(Schedule Group) - Maps to the specific hours for this office.Target_Queue(Queue) - The ACD queue for this office.Emergency_Override(Boolean) - A manual toggle to instantly close the office.Closed_Prompt(Prompt) - The specific audio file to play if the office is closed.
2. Capturing the Dialed Number in Architect
When a call hits the universal “Front Door” flow, you must identify which number was dialed.
- Open your Inbound Call Flow.
- Add an Update Data action at the very beginning of the flow.
- Create a string variable
Task.DialedNumber. - Assign it the system variable
Call.CalledAddress.- Architectural Note:
Call.CalledAddresscontains the exact E.164 formatted string (e.g.,+13125550199). Ensure the keys in your Data Table strictly match this format.
- Architectural Note:
3. Performing the Data Table Lookup
Use the dialed number to query the table and retrieve the office’s unique routing rules.
- Add a Data Table Lookup action.
- Select
DT_Regional_Routingas the table. - In the Key field, pass your
Task.DialedNumbervariable. - In the Outputs section, assign local variables to store the retrieved data:
- Map
Schedule_GrouptoTask.LocalSchedule. - Map
Target_QueuetoTask.LocalQueue. - Map
Emergency_OverridetoTask.IsEmergency.
- Map
4. Executing the Dynamic Logic
Now, use the retrieved variables to control the flow.
Step A: Emergency Check
- Add a Decision node:
Task.IsEmergency == True. - If True, play an emergency prompt and Disconnect.
- If False, proceed to the Schedule Check.
Step B: Schedule Group Evaluation
- Add an Evaluate Schedule Group action.
- Instead of hardcoding a schedule, bind it to the variable:
Task.LocalSchedule. - Open Path: Add a Transfer to ACD node and bind the queue to
Task.LocalQueue. - Closed Path: Play the customized
Task.Closed_Promptand route to Voicemail.
Validation, Edge Cases & Troubleshooting
Edge Case 1: The “Row Not Found” Failure
If a new toll-free number is purchased and mapped to the flow, but the administrator forgets to add that number to the Data Table, the Data Table Lookup action will fail and trigger the Not Found output path.
- Troubleshooting: You MUST configure the
Not Foundoutput path to route to a universal default queue or a generic “We are currently experiencing technical difficulties” prompt. Never leave theNot Foundpath empty, as it will abruptly hang up on the caller.
Edge Case 2: Caching Delays
Data Tables are aggressively cached by the Architect runtime engine to ensure high performance under massive call volume.
- The Trap: If an administrator checks the
Emergency_Overridebox in the Data Table to True, it can take up to 5 minutes for the edge servers to invalidate the cache and begin routing calls to the emergency path. - Solution: Administrators must be trained on this 5-minute propagation delay. For instantaneous sub-second emergency routing, you must use a CRM Data Action, not a Data Table.
Data Validation
- To test without dialing, use the Architect Debugger.
- Enter a test DNIS into the
Call.CalledAddresssimulation field. - Step through the flow and verify that the Data Table Lookup successfully populated the
Task.LocalQueuevariable with the correct object reference.
Official References
For exact syntax and caching behavior, consult the official documentation:
- Data Tables Overview: Genesys Cloud Resource Center: Work with Data Tables
- Data Table Lookup Action: Genesys Cloud Resource Center: Data Table Lookup action
- Evaluate Schedule Group Action: Genesys Cloud Resource Center: Evaluate Schedule Group action