Implementing Data Table Lookups for Dynamic Business Hour Routing

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/Edit
    • Architect > 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.

  1. Navigate to Architect > Data Tables and create a new table named DT_Regional_Routing.
  2. Define the Reference Key (the column used to search the table). Set this to DNIS_Number (String).
  3. 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.

  1. Open your Inbound Call Flow.
  2. Add an Update Data action at the very beginning of the flow.
  3. Create a string variable Task.DialedNumber.
  4. Assign it the system variable Call.CalledAddress.
    • Architectural Note: Call.CalledAddress contains the exact E.164 formatted string (e.g., +13125550199). Ensure the keys in your Data Table strictly match this format.

3. Performing the Data Table Lookup

Use the dialed number to query the table and retrieve the office’s unique routing rules.

  1. Add a Data Table Lookup action.
  2. Select DT_Regional_Routing as the table.
  3. In the Key field, pass your Task.DialedNumber variable.
  4. In the Outputs section, assign local variables to store the retrieved data:
    • Map Schedule_Group to Task.LocalSchedule.
    • Map Target_Queue to Task.LocalQueue.
    • Map Emergency_Override to Task.IsEmergency.

4. Executing the Dynamic Logic

Now, use the retrieved variables to control the flow.

Step A: Emergency Check

  1. Add a Decision node: Task.IsEmergency == True.
  2. If True, play an emergency prompt and Disconnect.
  3. If False, proceed to the Schedule Check.

Step B: Schedule Group Evaluation

  1. Add an Evaluate Schedule Group action.
  2. Instead of hardcoding a schedule, bind it to the variable: Task.LocalSchedule.
  3. Open Path: Add a Transfer to ACD node and bind the queue to Task.LocalQueue.
  4. Closed Path: Play the customized Task.Closed_Prompt and 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 Found output path to route to a universal default queue or a generic “We are currently experiencing technical difficulties” prompt. Never leave the Not Found path 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_Override box 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

  1. To test without dialing, use the Architect Debugger.
  2. Enter a test DNIS into the Call.CalledAddress simulation field.
  3. Step through the flow and verify that the Data Table Lookup successfully populated the Task.LocalQueue variable with the correct object reference.

Official References

For exact syntax and caching behavior, consult the official documentation: