Stuck on a simple data action in CXone Architect. Calling a basic internal REST endpoint to fetch user status. The request hits the server fine, I get a 200 OK with valid JSON back. Problem is the output mapping in the success block. The variable keeps resolving to undefined even though the response body is clearly populated. Here’s the mapping JSON I’m using in the data action config:
{
"success": {
"output": {
"userStatus": "$.status",
"userId": "$.id"
}
}
}
The actual JSON response from the endpoint looks like this:
{
"data": {
"id": "12345",
"status": "available"
}
}
I’ve tried changing the path to $.data.status and even just status. Nothing works. The debug log shows the response is received, but the mapped variables are empty strings when passed to the next block. Am I missing a wrapper layer in the mapping? The docs say to use JSONPath, but maybe the data action wraps the body in a response object first? Can’t find any examples of this specific failure mode.
The issue isn’t the endpoint, it’s how Architect handles the root object. When you map $.status, you’re pointing at the root of the raw HTTP response. But Data Actions wrap that response in a specific structure. You need to dig one level deeper into the output property.
Try this mapping instead:
{
"success": {
"output": {
"userStatus": "$.output.status"
}
}
}
Genesys Cloud injects the actual JSON body into the output key of the Data Action result object. If your endpoint returns {"status": "available"}, the full Data Action output looks like {"output": {"status": "available"}}. Skipping that layer makes the variable resolve to undefined because $.status doesn’t exist at the root level of the action result.
You can verify this by adding a Debug node after the Data Action and checking the full payload. You’ll see the wrapper clearly. It’s a common trip-up when moving from simple HTTP calls to Architect flows. The output key is mandatory for most standard REST actions unless you’re using a custom action that explicitly flattens the response.
Also check if your endpoint returns an array. If it does, you’ll need to index it: $.output[0].status. But for a single object, $.output.status is the fix. Don’t forget to save the flow and deploy a test version before running it in production. Architect caches mappings aggressively, so a stale deploy might still show undefined even after the fix.