We are migrating a legacy workflow from a custom middleware solution into CXone Studio to reduce infrastructure costs. The specific requirement involves fetching user profile data from an internal microservice via REST API and then extracting a specific nested value to drive downstream routing logic.
The API endpoint returns a standard JSON response. We are using the GetRESTProxy action to make the call. The request configuration seems correct, as we are receiving a 200 OK status and the full payload in the response object.
The issue arises during the parsing phase. We are using the ASSIGN action with a JSONPath expression to extract the value. The target value is located at $.data.preferences[0].language.
Here is the configuration we are currently using in the Studio flow:
Action: ASSIGN
Variable: profileLanguage
Expression: $.GetRESTProxy.Response.Body.data.preferences[0].language
When the flow executes, the profileLanguage variable remains null or empty, even though the JSON response clearly contains the data. We have verified the response body by logging it to a debug variable, and the structure matches our expectations exactly.
{
"status": "success",
"data": {
"userId": "12345",
"preferences": [
{
"language": "en-US",
"timezone": "Europe/Berlin"
}
]
}
}
We suspect that the JSONPath implementation in CXone Studio might not support array indexing in the same way as standard libraries. We have tried iterating through the array using a FOR_EACH loop over $.GetRESTProxy.Response.Body.data.preferences, but accessing the language property inside the loop also results in null values.
Has anyone encountered similar issues with parsing nested arrays from GetRESTProxy responses? We are looking for a reliable pattern to extract values from indexed arrays within the Studio environment without resorting to external webhooks.