Can anyone clarify the correct JSON structure for a DBConnector action when querying a nested attribute?
Background
I am migrating a legacy lookup flow from a custom REST endpoint to a native CXone Studio script. The target data resides in a DynamoDB table where the key is a simple ID, but the value is a complex JSON object. I need to extract a specific nested field (metadata.region) for downstream logic.
Issue
The DBConnector action seems to treat the result as a flat map. When I reference metadata.region in the subsequent ASSIGN action, it returns null. The raw JSON payload from the connector looks like this:
{
"id": "usr_123",
"metadata": {
"region": "sa-east-1",
"tier": "gold"
}
}
I have tried referencing it as result.metadata.region and result["metadata"]["region"], but neither works in the Studio expression evaluator. Is there a specific flattening behavior I am missing, or should I be using a different connector type for nested structures?
Troubleshooting
- Verified the DynamoDB item exists and is accessible via direct API call.
- Checked Studio logs; the DBConnector returns a 200 OK with the full JSON body.
- Confirmed that the variable name in the ASSIGN action matches the DBConnector output variable exactly.