Data Action JSON Parse Error on Cognigy Profile Token Response

Running a Genesys Cloud Architect Data Action to fetch user context from NICE Cognigy. The HTTP GET to the Cognigy profile endpoint returns a 200 OK with valid JSON, but the Data Action fails with a generic parsing error before mapping the fields.

The issue seems to be the nested structure of the profile data. Genesys expects a flat or specific JSON structure for the mapping step, but Cognigy wraps everything in a data object with nested arrays.

Here’s the raw response body from the external service:

{
 "status": 200,
 "data": {
 "userId": "12345",
 "preferences": [
 {
 "key": "language",
 "value": "es"
 }
 ]
 }
}

The Data Action configuration uses response.data.preferences[0].value in the mapping, but the logs show a JSON parse failure on the response body. I’ve tried wrapping the response in a try-catch block within a custom script step, but the error persists at the HTTP action level.

Is there a way to preprocess the JSON payload within the Data Action before the mapping step? Or do I need to flatten the response on the Cognigy side? The standard JSON path syntax doesn’t seem to handle the array indexing correctly in this context.