DBConnector in Studio returning empty result set despite valid query

We are implementing a database lookup within a CXone Studio script using the DBConnector action. The configuration points to a valid ODBC connection, and the SQL statement is straightforward: SELECT agent_id FROM routing_agents WHERE status = ‘ACTIVE’. The action executes without throwing an error, yet the resulting list variable remains empty. We have verified that the data exists in the source database. Is there a specific permission requirement or a timeout issue we are missing?

The ODBC driver usually returns empty if the result set isn’t explicitly mapped to a list variable in the Studio configuration. It doesn’t auto-populate a generic variable.

Check the DBConnector action settings. You need to set the “Result Variable” field to a specific list type (e.g., List<String> or List<Object> depending on your SDK version). If that’s already done, the issue is almost certainly the SQL injection format. Studio treats the status value as a parameter, not a literal string in the query text.

Try this exact setup:

  1. SQL Statement:
SELECT agent_id FROM routing_agents WHERE status = ?
  1. Parameters:
    Add a single parameter.
  • Name: statusParam
  • Value: ACTIVE (or reference a variable containing that string)
  • Type: String
  1. Result Mapping:
    Ensure the “Result Variable” is set to agentList (or whatever your variable is named) and the type matches the column definition.

If you’re still getting nothing, enable the “Log SQL” option in the action perties. It’ll show you the actual query sent to the database. Sometimes the ODBC driver adds schema prefixes that break simple selects if your view isn’t aliased correctly. Also, check if the database user has SELECT permissions on that specific table. ODBC connections in CXone often run under a restricted service account that can connect but can’t read certain tables.